Skip to content

Commit 6e33626

Browse files
committed
dev-demo: add check for promo_picture before attaching files in carsResourseTemplate
AdminForth/1766/for-some-reason-upload-plugin-
1 parent b39d84c commit 6e33626

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dev-demo/resources/cars_resources/carsResourseTemplate.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ export default function carsResourseTemplate(resourceId: string, dataSource: Car
349349
model: 'gpt-image-1',
350350
}),
351351
attachFiles: async ({ record }) => {
352+
if (!record.promo_picture) {
353+
return [];
354+
}
352355
return [`https://tmpbucket-adminforth.s3.eu-central-1.amazonaws.com/${record.promo_picture}`];
353356
},
354357
generationPrompt: "Generate a high-quality promotional image for a car with model {{model}} and color {{color}}. The car is a {{body_type}} type. The image should be vibrant and eye-catching, suitable for advertising purposes.",

0 commit comments

Comments
 (0)