Enhance DocumentSchema and MinioService to support document folder creation. Update document creation logic to include folder setup in Minio after document creation. Refactor createDocumentFolder method to initialize a default page in the document folder. This improves document management and organization within the Minio storage system.
This commit is contained in:
@@ -198,7 +198,7 @@ export class DocumentSchema extends PothosSchema {
|
||||
if (ctx.isSubscription) throw new Error('Not allowed')
|
||||
const userId = ctx.http?.me?.id
|
||||
if (!userId) throw new Error('User not found')
|
||||
return await this.prisma.document.create({
|
||||
const document = await this.prisma.document.create({
|
||||
...query,
|
||||
data: {
|
||||
...args.input,
|
||||
@@ -211,6 +211,9 @@ export class DocumentSchema extends PothosSchema {
|
||||
},
|
||||
},
|
||||
})
|
||||
// create document in minio
|
||||
await this.minio.createDocumentFolder(document.id)
|
||||
return document
|
||||
},
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user