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:
2024-12-09 17:06:23 +07:00
parent 951511228a
commit 8d0b80f09c
5 changed files with 1166 additions and 1257 deletions

View File

@@ -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')
}