diff --git a/src/common/backend/clients/siyuan/client.ts b/src/common/backend/clients/siyuan/client.ts index 3f9b5be6..4b3e6691 100644 --- a/src/common/backend/clients/siyuan/client.ts +++ b/src/common/backend/clients/siyuan/client.ts @@ -30,7 +30,7 @@ export class SiYuanClient { const res = await this.request.post(`api/notebook/lsNotebooks`, { data: {}, }); - return res.data.files + return (res.data.notebooks ?? res.data.files ?? []) .map(p => { if (typeof p === 'object') { return p; diff --git a/src/common/backend/clients/siyuan/types.ts b/src/common/backend/clients/siyuan/types.ts index 49a87370..ad70cd9b 100644 --- a/src/common/backend/clients/siyuan/types.ts +++ b/src/common/backend/clients/siyuan/types.ts @@ -14,5 +14,8 @@ export interface ISiyuanUploadImageResponse { } export interface ISiyuanFetchNotesResponse { - data: { files: string[] | { name: string; id: string; closed?: boolean }[] }; + data: { + files?: string[] | { name: string; id: string; closed?: boolean }[]; + notebooks?: string[] | { name: string; id: string; closed?: boolean }[]; + }; }