File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,20 @@ export default {
318
318
319
319
await validateSchema ( subBrandingSchema , branding )
320
320
321
+ if ( branding . logoId ) {
322
+ const upload = await models . upload . findUnique ( { where : { id : Number ( branding . logoId ) } } )
323
+ if ( ! upload ) {
324
+ throw new GqlInputError ( 'logo not found' )
325
+ }
326
+ }
327
+
328
+ if ( branding . faviconId ) {
329
+ const upload = await models . upload . findUnique ( { where : { id : Number ( branding . faviconId ) } } )
330
+ if ( ! upload ) {
331
+ throw new GqlInputError ( 'favicon not found' )
332
+ }
333
+ }
334
+
321
335
return await models . subBranding . upsert ( {
322
336
where : { subName } ,
323
337
update : { ...branding , subName } ,
@@ -359,6 +373,9 @@ export default {
359
373
domain : async ( sub , args , { models } ) => {
360
374
return models . domain . findUnique ( { where : { subName : sub . name } } )
361
375
} ,
376
+ branding : async ( sub , args , { models } ) => {
377
+ return models . subBranding . findUnique ( { where : { subName : sub . name } } )
378
+ } ,
362
379
createdAt : sub => sub . createdAt || sub . created_at
363
380
}
364
381
}
You can’t perform that action at this time.
0 commit comments