chore: update biome configuration and enhance error handling in schema files
- Enabled useIgnoreFile in biome.json for better file management. - Updated various correctness and style rules in biome.json to enforce stricter coding standards. - Added new biome lint command in package.json for improved code quality checks. - Refactored error handling in multiple schema files to use consistent error throwing patterns, enhancing readability and maintainability. - Improved user authentication checks across various schemas to ensure proper access control.
This commit is contained in:
@@ -68,14 +68,20 @@ export class WorkshopMeetingRoomSchema extends PothosSchema {
|
||||
}),
|
||||
},
|
||||
resolve: async (_, args, ctx) => {
|
||||
if (ctx.isSubscription) throw new Error('Not allowed')
|
||||
if (!ctx.http?.me) throw new Error('Unauthorized')
|
||||
if (ctx.isSubscription) {
|
||||
throw new Error('Not allowed')
|
||||
}
|
||||
if (!ctx.http?.me) {
|
||||
throw new Error('Unauthorized')
|
||||
}
|
||||
const meetingRoom = await this.prisma.workshopMeetingRoom.findUnique({
|
||||
where: {
|
||||
workshopId: args.workshopId,
|
||||
},
|
||||
})
|
||||
if (!meetingRoom) throw new Error('Meeting room not found')
|
||||
if (!meetingRoom) {
|
||||
throw new Error('Meeting room not found')
|
||||
}
|
||||
const serverUrl = this.livekitService.getServerUrl()
|
||||
return {
|
||||
id: meetingRoom.id,
|
||||
|
||||
Reference in New Issue
Block a user