fix: convert raw memo

This commit is contained in:
email
2022-03-29 21:24:44 +08:00
parent b0d3b5c76e
commit 13684488ef
2 changed files with 8 additions and 53 deletions

View File

@ -17,9 +17,7 @@ class MemoService {
}
const data = await api.getMyMemos();
const memos: Model.Memo[] = data.map((m) => {
return this.convertResponseModelMemo(m);
});
const memos: Model.Memo[] = data.map((m) => this.convertResponseModelMemo(m));
appStore.dispatch({
type: "SET_MEMOS",
payload: {
@ -138,6 +136,7 @@ class MemoService {
private convertResponseModelMemo(memo: Model.Memo): Model.Memo {
return {
...memo,
id: String(memo.id),
createdAt: utils.getDataStringWithTs(memo.createdTs),
updatedAt: utils.getDataStringWithTs(memo.updatedTs),
};