fix: api compatibility with OctoBase (#1790)
This commit is contained in:
@@ -236,6 +236,7 @@ describe('api', () => {
|
|||||||
const publicBinary = await workspaceApis.downloadWorkspace(id, true);
|
const publicBinary = await workspaceApis.downloadWorkspace(id, true);
|
||||||
expect(binary).toBeInstanceOf(ArrayBuffer);
|
expect(binary).toBeInstanceOf(ArrayBuffer);
|
||||||
expect(publicBinary).toBeInstanceOf(ArrayBuffer);
|
expect(publicBinary).toBeInstanceOf(ArrayBuffer);
|
||||||
|
expect(binary).toEqual(publicBinary);
|
||||||
expect(binary.byteLength).toEqual(publicBinary.byteLength);
|
expect(binary.byteLength).toEqual(publicBinary.byteLength);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ export function createWorkspaceApis(prefixUrl = '/') {
|
|||||||
published = false
|
published = false
|
||||||
): Promise<ArrayBuffer> => {
|
): Promise<ArrayBuffer> => {
|
||||||
if (published) {
|
if (published) {
|
||||||
return fetch(prefixUrl + `api/public/doc/${workspaceId}`, {
|
return fetch(prefixUrl + `api/public/workspace/${workspaceId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).then(r => r.arrayBuffer());
|
}).then(r => r.arrayBuffer());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user