chore: update subproject commit reference and enhance error handling in schema files
- Updated the subproject commit reference in epess-database to the latest version. - Changed error messages in CollaborationSession and Document schemas for improved clarity and security. - Refactored error handling logic to ensure consistent user authentication checks across multiple schema files. - Enhanced GraphQL module configuration with new options for better performance and error response handling.
This commit is contained in:
@@ -461,7 +461,10 @@ export class DocumentSchema extends PothosSchema {
|
||||
if (!document.isPublic) {
|
||||
if (
|
||||
document.ownerId !== ctx.websocket?.me?.id &&
|
||||
!document.collaborators.some((c) => c.userId === ctx.websocket?.me?.id && c.writable && c.readable)
|
||||
!document.collaborators.some((c) =>
|
||||
c.userId === ctx.websocket?.me?.id &&
|
||||
(c.writable || c.readable)
|
||||
)
|
||||
) {
|
||||
throw new Error('User is not owner or collaborator of document')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user