diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/LinkSelected.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/LinkSelected.tsx index bf11142a1..a10f653a3 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/LinkSelected.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/LinkSelected.tsx @@ -18,7 +18,7 @@ export const LinkSelected = ({ isEditable, onUpdateTitle, }: LinkSelectedProps) => { - const { data: doc } = useDoc({ id: docId, withoutContent: true }); + const { data: doc } = useDoc({ id: docId }); /** * Update the content title if the referenced doc title changes diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/api/useDoc.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/api/useDoc.tsx index 5441634c9..54aeb61d6 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-management/api/useDoc.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-management/api/useDoc.tsx @@ -6,15 +6,10 @@ import { Doc } from '../types'; export type DocParams = { id: string; - withoutContent?: boolean; }; -export const getDoc = async ({ - id, - withoutContent, -}: DocParams): Promise => { - const params = withoutContent ? '?without_content=true' : ''; - const response = await fetchAPI(`documents/${id}/${params}`); +export const getDoc = async ({ id }: DocParams): Promise => { + const response = await fetchAPI(`documents/${id}/`); if (!response.ok) { throw new APIError('Failed to get the doc', await errorCauses(response)); @@ -24,7 +19,6 @@ export const getDoc = async ({ }; export const KEY_DOC = 'doc'; -export const KEY_DOC_VISIBILITY = 'doc-visibility'; export function useDoc( param: DocParams, diff --git a/src/frontend/servers/y-provider/__tests__/collaborationBackend.test.ts b/src/frontend/servers/y-provider/__tests__/collaborationBackend.test.ts index 561ece876..17c88cf0b 100644 --- a/src/frontend/servers/y-provider/__tests__/collaborationBackend.test.ts +++ b/src/frontend/servers/y-provider/__tests__/collaborationBackend.test.ts @@ -19,13 +19,10 @@ describe('CollaborationBackend', () => { const { fetchDocument } = await import('@/api/collaborationBackend'); const documentId = 'test-document-123'; - await fetchDocument( - { name: documentId, withoutContent: true }, - { cookie: 'test-cookie' }, - ); + await fetchDocument({ name: documentId }, { cookie: 'test-cookie' }); expect(axiosGetSpy).toHaveBeenCalledWith( - `http://app-dev:8000/api/v1.0/documents/${documentId}/?without_content=true`, + `http://app-dev:8000/api/v1.0/documents/${documentId}/`, expect.objectContaining({ headers: expect.objectContaining({ 'X-Y-Provider-Key': 'test-yprovider-key', diff --git a/src/frontend/servers/y-provider/__tests__/hocuspocusWS.test.ts b/src/frontend/servers/y-provider/__tests__/hocuspocusWS.test.ts index 3a23f90bd..16d6c929d 100644 --- a/src/frontend/servers/y-provider/__tests__/hocuspocusWS.test.ts +++ b/src/frontend/servers/y-provider/__tests__/hocuspocusWS.test.ts @@ -228,7 +228,7 @@ describe('Server Tests', () => { wsHocus.stopConnectionAttempt(); expect(data.reason).toBe('permission-denied'); expect(fetchDocumentMock).toHaveBeenCalledExactlyOnceWith( - { name: room, withoutContent: true }, + { name: room }, expect.any(Object), ); wsHocus.webSocket?.close(); @@ -273,7 +273,7 @@ describe('Server Tests', () => { wsHocus.stopConnectionAttempt(); expect(data.reason).toBe('permission-denied'); expect(fetchDocumentMock).toHaveBeenCalledExactlyOnceWith( - { name: room, withoutContent: true }, + { name: room }, expect.any(Object), ); wsHocus.webSocket?.close(); @@ -322,7 +322,7 @@ describe('Server Tests', () => { wsHocus.destroy(); expect(fetchDocumentMock).toHaveBeenCalledWith( - { name: room, withoutContent: true }, + { name: room }, expect.any(Object), ); @@ -371,7 +371,7 @@ describe('Server Tests', () => { wsHocus.destroy(); expect(fetchDocumentMock).toHaveBeenCalledWith( - { name: room, withoutContent: true }, + { name: room }, expect.any(Object), ); diff --git a/src/frontend/servers/y-provider/src/api/collaborationBackend.ts b/src/frontend/servers/y-provider/src/api/collaborationBackend.ts index a2d002794..a9ae76b24 100644 --- a/src/frontend/servers/y-provider/src/api/collaborationBackend.ts +++ b/src/frontend/servers/y-provider/src/api/collaborationBackend.ts @@ -75,11 +75,10 @@ async function fetch( } export function fetchDocument( - { name, withoutContent }: { name: string; withoutContent?: boolean }, + { name }: { name: string }, requestHeaders: IncomingHttpHeaders, ): Promise { - const params = withoutContent ? '?without_content=true' : ''; - return fetch(`/api/v1.0/documents/${name}/${params}`, requestHeaders); + return fetch(`/api/v1.0/documents/${name}/`, requestHeaders); } export function fetchCurrentUser( diff --git a/src/frontend/servers/y-provider/src/servers/hocuspocusServer.ts b/src/frontend/servers/y-provider/src/servers/hocuspocusServer.ts index 1686960b9..d60ec1947 100644 --- a/src/frontend/servers/y-provider/src/servers/hocuspocusServer.ts +++ b/src/frontend/servers/y-provider/src/servers/hocuspocusServer.ts @@ -40,7 +40,7 @@ export const hocuspocusServer = new Server({ try { const document = await fetchDocument( - { name: documentName, withoutContent: true }, + { name: documentName }, requestHeaders, );