From 701b96b8e47976bf1fd1106d7c6d5f02b8616abe Mon Sep 17 00:00:00 2001 From: "wuruipeng.liuliu" Date: Thu, 19 May 2022 16:51:23 +0800 Subject: [PATCH] =?UTF-8?q?reactor:=20=E6=94=AF=E6=8C=81=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=8B=89=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.ts | 11 ++++++++++- package.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 70be014..78d7d36 100644 --- a/index.ts +++ b/index.ts @@ -8,6 +8,7 @@ interface Memo { deleted_at: string; updated_at: string; slug: string; + files; } @@ -77,7 +78,15 @@ async function getMemos(isToday: boolean = false): Promise> { (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 diff --git a/package.json b/package.json index 646e9bc..e6359ab 100644 --- a/package.json +++ b/package.json @@ -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": {