mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
web: update restful api
This commit is contained in:
@ -117,6 +117,11 @@ class MemoService {
|
||||
});
|
||||
}
|
||||
|
||||
public async getLinkedMemos(memoId: string): Promise<Model.Memo[]> {
|
||||
const { memos } = this.getState();
|
||||
return memos.filter((m) => m.content.includes(memoId));
|
||||
}
|
||||
|
||||
public async createMemo(text: string): Promise<Model.Memo> {
|
||||
const { data: memo } = await api.createMemo(text);
|
||||
return memo;
|
||||
@ -126,11 +131,6 @@ class MemoService {
|
||||
const { data: memo } = await api.updateMemo(memoId, text);
|
||||
return memo;
|
||||
}
|
||||
|
||||
public async getLinkedMemos(memoId: string): Promise<Model.Memo[]> {
|
||||
const { data } = await api.getLinkedMemos(memoId);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
const memoService = new MemoService();
|
||||
|
Reference in New Issue
Block a user