phong bat

This commit is contained in:
2024-10-17 15:15:08 +07:00
parent 59923b02cb
commit 5c56e79d63
19 changed files with 456 additions and 145 deletions

View File

@@ -24,17 +24,30 @@ export class UploadedFileSchema extends PothosSchema {
return this.builder.prismaObject('UploadedFile', {
description: 'A file uploaded by a user.',
fields: (t) => ({
id: t.exposeID('id'),
userId: t.exposeID('userId'),
fileName: t.exposeString('fileName'),
id: t.exposeID('id', {
description: 'The ID of the uploaded file.',
}),
userId: t.exposeID('userId', {
description: 'The ID of the user who uploaded the file.',
}),
fileName: t.exposeString('fileName', {
description: 'The name of the file.',
}),
// expose enum
fileType: t.expose('fileType', {
type: UploadedFileType,
nullable: false,
description: 'The type of the file.',
}),
fileUrl: t.exposeString('fileUrl'),
uploadedAt: t.expose('uploadedAt', { type: 'DateTime' }),
user: t.relation('user'),
uploadedAt: t.expose('uploadedAt', {
type: 'DateTime',
nullable: true,
description: 'The date and time the file was uploaded.',
}),
user: t.relation('user', {
description: 'The user who uploaded the file.',
}),
}),
});
}