Skip to content

Commit

Permalink
reactor: 支持图片拉取
Browse files Browse the repository at this point in the history
  • Loading branch information
wuruipeng.liuliu committed May 19, 2022
1 parent eeb04a8 commit 701b96b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface Memo {
deleted_at: string;
updated_at: string;
slug: string;
files;
}


Expand Down Expand Up @@ -77,7 +78,15 @@ async function getMemos(isToday: boolean = false): Promise<Array<Memo>> {
(memo) => new Date(memo.created_at).getDay() == new Date().getDay()
);
})
return data;
return data
.map((item) => {
let files = item.files ? item.files : [];
files.forEach((el) => {
item.content = item.content + ` ![](${el?.url})`;
});
return item;
})
.reverse();
}

//Inputs 5 numbered blocks when called
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flomo_memos_sync",
"version": "0.0.1",
"version": "0.0.2",
"description": "sync flomo memons",
"main": "dist/index.html",
"targets": {
Expand Down

0 comments on commit 701b96b

Please sign in to comment.