File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,10 @@ export function GenerateButton({
80
80
const cannotPromote = model ?. meta ?. cannotPromote ?? false ;
81
81
const isAvailable = model ?. availability !== Availability . Private ;
82
82
const isPublished = model ?. status === ModelStatus . Published ;
83
+ const isPoi = model ?. poi ?? false ;
83
84
84
- const showBid = features . auctions && ! canGenerate && isAvailable && isPublished && ! cannotPromote ;
85
+ const showBid =
86
+ features . auctions && ! canGenerate && isAvailable && isPublished && ! cannotPromote && ! isPoi ;
85
87
86
88
if ( ! showBid && ! canGenerate ) return null ;
87
89
Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ import {
27
27
throwInsufficientFundsError ,
28
28
throwNotFoundError ,
29
29
} from '~/server/utils/errorHandling' ;
30
- import { AuctionType , Availability , BuzzAccountType } from '~/shared/utils/prisma/enums' ;
30
+ import {
31
+ AuctionType ,
32
+ Availability ,
33
+ BuzzAccountType ,
34
+ ModelStatus ,
35
+ } from '~/shared/utils/prisma/enums' ;
31
36
import { formatDate } from '~/utils/date-helpers' ;
32
37
import { withRetries } from '~/utils/errorHandling' ;
33
38
import { signalClient } from '~/utils/signal-client' ;
@@ -368,6 +373,8 @@ export const createBid = async ({
368
373
select : {
369
374
type : true ,
370
375
meta : true ,
376
+ poi : true ,
377
+ status : true ,
371
378
} ,
372
379
} ,
373
380
} ,
@@ -377,9 +384,14 @@ export const createBid = async ({
377
384
if ( mv . availability === Availability . Private )
378
385
throw throwBadRequestError ( 'Invalid model version.' ) ;
379
386
387
+ if ( mv . model . status !== ModelStatus . Published )
388
+ throw throwBadRequestError ( 'Invalid model version.' ) ;
389
+
380
390
if ( ( mv . model . meta as ModelMeta | null ) ?. cannotPromote === true )
381
391
throw throwBadRequestError ( 'Invalid model version.' ) ;
382
392
393
+ if ( mv . model . poi ) throw throwBadRequestError ( 'Invalid model version.' ) ;
394
+
383
395
const allowedTypeData = getModelTypesForAuction ( auctionData . auctionBase ) ;
384
396
const matchAllowed = allowedTypeData . find ( ( a ) => a . type === mv . model . type ) ;
385
397
if ( ! matchAllowed ) throw throwBadRequestError ( 'Invalid model type for this auction.' ) ;
You can’t perform that action at this time.
0 commit comments