diff --git a/src/LiveKit/livekit.room.service.ts b/src/LiveKit/livekit.room.service.ts index 2cd79c6..a802893 100644 --- a/src/LiveKit/livekit.room.service.ts +++ b/src/LiveKit/livekit.room.service.ts @@ -48,7 +48,7 @@ export class LiveKitRoomService { fileOutputs: [ { fileType: EncodedFileType.MP4, - filepath: `epess/records/${roomId}/${roomId}-${DateTimeUtils.now().toISO()}`, + filepath: `${process.env.BUCKET_NAME}/records/${roomId}/${roomId}-${DateTimeUtils.now().toISO()}`, output: { case: 's3', value: { @@ -93,7 +93,7 @@ export class LiveKitRoomService { region: process.env.MINIO_REGION, }, }, - filepath: `epess/records/${roomId}/${roomId}-${DateTimeUtils.now().toISO()}`, + filepath: `${process.env.BUCKET_NAME}/records/${roomId}/${roomId}-${DateTimeUtils.now().toISO()}`, }, ], }), diff --git a/src/Service/service.schema.ts b/src/Service/service.schema.ts index 927902e..1bef4f1 100644 --- a/src/Service/service.schema.ts +++ b/src/Service/service.schema.ts @@ -115,6 +115,21 @@ export class ServiceSchema extends PothosSchema { managedService: t.relation('managedService', { description: 'The managed service for the service.', }), + feedbacked: t.boolean({ + description: 'Whether the user has already provided feedback for the service.', + nullable: true, + resolve: async (service, _args, ctx) => { + if (ctx.isSubscription) return null + if (!ctx.http.me) return false + const serviceFeedbacks = await this.prisma.serviceFeedback.findMany({ + where: { + serviceId: service.id, + userId: ctx.http.me.id, + }, + }) + return serviceFeedbacks.length > 0 + }, + }), }), }) } diff --git a/src/ServiceFeedback/servicefeedback.schema.ts b/src/ServiceFeedback/servicefeedback.schema.ts index 6d374fb..0ea15a5 100644 --- a/src/ServiceFeedback/servicefeedback.schema.ts +++ b/src/ServiceFeedback/servicefeedback.schema.ts @@ -1,10 +1,5 @@ import { Inject, Injectable } from '@nestjs/common' -import { - Pothos, - PothosRef, - PothosSchema, - SchemaBuilderToken, -} from '@smatch-corp/nestjs-pothos' +import { Pothos, PothosRef, PothosSchema, SchemaBuilderToken } from '@smatch-corp/nestjs-pothos' import { Builder } from '../Graphql/graphql.builder' import { PrismaService } from '../Prisma/prisma.service' @@ -63,9 +58,8 @@ export class ServiceFeedbackSchema extends PothosSchema { serviceFeedbacks: t.prismaField({ type: [this.serviceFeedback()], args: this.builder.generator.findManyArgs('ServiceFeedback'), - description: - 'Retrieve a list of service feedbacks with optional filtering, ordering, and pagination.', - resolve: async (query, root, args, ctx, info) => { + description: 'Retrieve a list of service feedbacks with optional filtering, ordering, and pagination.', + resolve: async (query, _root, args, _ctx, _info) => { return await this.prisma.serviceFeedback.findMany({ ...query, skip: args.skip ?? undefined,