feat: update file output paths and add feedback tracking to service schema
- Modified file output paths in LiveKitRoomService to utilize the BUCKET_NAME environment variable for dynamic S3 storage. - Introduced a new `feedbacked` field in ServiceSchema to track whether a user has provided feedback for a service, enhancing user interaction capabilities. - Cleaned up the ServiceFeedback schema by refining the resolve function for better clarity and consistency.
This commit is contained in:
@@ -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
|
||||
},
|
||||
}),
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user