Skip to content

Commit

Permalink
feat: support new siyuan
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed Nov 28, 2021
1 parent d54a8ec commit 1c9532c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/backend/clients/siyuan/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class SiYuanClient {
const res = await this.request.post<ISiyuanFetchNotesResponse>(`api/notebook/lsNotebooks`, {
data: {},
});
return res.data.files
return (res.data.notebooks ?? res.data.files ?? [])
.map(p => {
if (typeof p === 'object') {
return p;
Expand Down
5 changes: 4 additions & 1 deletion src/common/backend/clients/siyuan/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }[];
};
}

0 comments on commit 1c9532c

Please sign in to comment.