add minio service and start workaround on CI pipeline

This commit is contained in:
2024-10-12 22:07:46 +07:00
parent 9c111965c5
commit 7131d147ea
7 changed files with 433 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
import { Module, Global } from '@nestjs/common';
@Global()
@Module({})
export class MinioModule {}

View File

@@ -0,0 +1,9 @@
import { forwardRef, Inject, Injectable } from '@nestjs/common';
@Injectable()
export class MinioService {
constructor(
@Inject(forwardRef(() => ConfigService))
private configService: ConfigService,
) {}
}

View File

@@ -28,7 +28,7 @@ export class UploadedDocumentSchema extends PothosSchema {
status: t.exposeString('status'),
type: t.exposeString('type'),
documentUrl: t.exposeString('documentUrl'),
uploadedAt: t.expose('uploadedAt', { type: 'DateTime' as any }),
uploadedAt: t.expose('uploadedAt', { type: 'DateTime' }),
}),
});
}
@@ -60,5 +60,24 @@ export class UploadedDocumentSchema extends PothosSchema {
},
}),
}));
// Mutations section
this.builder.mutationFields((t) => ({
createUploadedDocument: t.prismaField({
type: this.uploadedDocument(),
args: {
input: t.arg({
type: this.builder.generator.getCreateInput('UploadedDocument'),
required: true,
}),
},
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.uploadedDocument.create({
...query,
data: args.input,
});
},
}),
}));
}
}