update something can update

This commit is contained in:
2024-11-08 17:27:09 +07:00
parent 7eabba1868
commit d7c7f8a782
10 changed files with 93 additions and 19 deletions

View File

@@ -59,10 +59,24 @@ export class ServiceSchema extends PothosSchema {
description: 'The image file for the service.',
}),
imageFileId: t.exposeID('imageFileId', {
nullable: true,
description: 'The ID of the image file for the service.',
}),
imageFileUrl: t.exposeString('imageFileUrl', {
imageFileUrl: t.string({
nullable: true,
description: 'The URL of the image file for the service.',
resolve: async (service) => {
// get file id from imageFileUrl
const imageFileId = service.imageFileUrl
?.split('/')
.pop()
?.split('?')[0]
return await this.minioService.updatePresignUrl(
imageFileId ?? '',
'files',
service.imageFileUrl ?? undefined,
)
},
}),
status: t.expose('status', {
type: ServiceStatus,