chore: update daily dialog style

pull/84/head
boojack 3 years ago
parent 85ce72282b
commit babeb468c1

@ -48,11 +48,11 @@ export function patchUser(userPatch: UserPatch) {
return axios.patch<ResponseObject<User>>("/api/user/me", userPatch);
}
export function getMyMemos() {
export function getMemoList() {
return axios.get<ResponseObject<Memo[]>>("/api/memo");
}
export function getMyArchivedMemos() {
export function getArchivedMemoList() {
return axios.get<ResponseObject<Memo[]>>("/api/memo?rowStatus=ARCHIVED");
}
@ -80,7 +80,7 @@ export function deleteMemo(memoId: MemoId) {
return axios.delete(`/api/memo/${memoId}`);
}
export function getMyShortcuts() {
export function getShortcutList() {
return axios.get<ResponseObject<Shortcut[]>>("/api/shortcut");
}
@ -99,3 +99,7 @@ export function deleteShortcutById(shortcutId: ShortcutId) {
export function uploadFile(formData: FormData) {
return axios.post<ResponseObject<Resource>>("/api/resource", formData);
}
export function getTagList() {
return axios.get<ResponseObject<string[]>>("/api/tag");
}

@ -4,7 +4,7 @@
@apply p-0 sm:py-16;
> .dialog-container {
@apply w-112 max-w-full p-0 rounded-none sm:rounded-lg;
@apply w-112 max-w-full grow sm:grow-0 bg-white p-0 rounded-none sm:rounded-lg;
> .dialog-header-container {
@apply flex flex-row justify-between items-center w-full p-6 pb-0 mb-0;
@ -70,7 +70,7 @@
}
> .tip-container {
@apply m-auto py-4 px-0;
@apply m-auto py-6 pb-12 px-0;
> .tip-text {
font-style: italic;

@ -1,5 +1,4 @@
import * as api from "../helpers/api";
import { TAG_REG } from "../helpers/consts";
import { createMemo, patchMemo, setMemos, setTags } from "../store/modules/memo";
import store from "../store";
@ -17,7 +16,7 @@ const memoService = {
},
fetchAllMemos: async () => {
const { data } = (await api.getMyMemos()).data;
const { data } = (await api.getMemoList()).data;
const memos = data.filter((m) => m.rowStatus !== "ARCHIVED").map((m) => convertResponseModelMemo(m));
store.dispatch(setMemos(memos));
@ -25,7 +24,7 @@ const memoService = {
},
fetchDeletedMemos: async () => {
const { data } = (await api.getMyArchivedMemos()).data;
const { data } = (await api.getArchivedMemoList()).data;
const deletedMemos = data.map((m) => {
return convertResponseModelMemo(m);
});
@ -42,16 +41,9 @@ const memoService = {
return null;
},
updateTagsState: () => {
const { memos } = memoService.getState();
const tagsSet = new Set<string>();
for (const m of memos) {
for (const t of Array.from(m.content.match(TAG_REG) ?? [])) {
tagsSet.add(t.replace(TAG_REG, "$1").trim());
}
}
store.dispatch(setTags(Array.from(tagsSet).filter((t) => Boolean(t))));
updateTagsState: async () => {
const { data } = (await api.getTagList()).data;
store.dispatch(setTags(data));
},
getLinkedMemos: async (memoId: MemoId): Promise<Memo[]> => {

@ -16,7 +16,7 @@ const shortcutService = {
},
getMyAllShortcuts: async () => {
const { data } = (await api.getMyShortcuts()).data;
const { data } = (await api.getShortcutList()).data;
const shortcuts = data.map((s) => convertResponseModelShortcut(s));
store.dispatch(setShortcuts(shortcuts));
},

Loading…
Cancel
Save