Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: api compatibility with OctoBase (#1790)

Himself6506a69b0767dc
diff --git a/packages/workspace/src/affine/__tests__/api.spec.ts b/packages/workspace/src/affine/__tests__/api.spec.ts
index bd69a42ea7..dfd7740fe0 100644
--- a/packages/workspace/src/affine/__tests__/api.spec.ts
+++ b/packages/workspace/src/affine/__tests__/api.spec.ts
@@ -236,6 +236,7 @@ describe('api', () => {
const publicBinary = await workspaceApis.downloadWorkspace(id, true);
expect(binary).toBeInstanceOf(ArrayBuffer);
expect(publicBinary).toBeInstanceOf(ArrayBuffer);
+ expect(binary).toEqual(publicBinary);
expect(binary.byteLength).toEqual(publicBinary.byteLength);
},
{
diff --git a/packages/workspace/src/affine/api/index.ts b/packages/workspace/src/affine/api/index.ts
index b8d84379a2..fc807417ab 100644
--- a/packages/workspace/src/affine/api/index.ts
+++ b/packages/workspace/src/affine/api/index.ts
@@ -387,7 +387,7 @@ export function createWorkspaceApis(prefixUrl = '/') {
published = false
): Promise<ArrayBuffer> => {
if (published) {
- return fetch(prefixUrl + `api/public/doc/${workspaceId}`, {
+ return fetch(prefixUrl + `api/public/workspace/${workspaceId}`, {
method: 'GET',
}).then(r => r.arrayBuffer());
} else {