Commit babeb468 authored by boojack's avatar boojack

chore: update daily dialog style

parent 85ce7228
...@@ -48,11 +48,11 @@ export function patchUser(userPatch: UserPatch) { ...@@ -48,11 +48,11 @@ export function patchUser(userPatch: UserPatch) {
return axios.patch<ResponseObject<User>>("/api/user/me", userPatch); return axios.patch<ResponseObject<User>>("/api/user/me", userPatch);
} }
export function getMyMemos() { export function getMemoList() {
return axios.get<ResponseObject<Memo[]>>("/api/memo"); return axios.get<ResponseObject<Memo[]>>("/api/memo");
} }
export function getMyArchivedMemos() { export function getArchivedMemoList() {
return axios.get<ResponseObject<Memo[]>>("/api/memo?rowStatus=ARCHIVED"); return axios.get<ResponseObject<Memo[]>>("/api/memo?rowStatus=ARCHIVED");
} }
...@@ -80,7 +80,7 @@ export function deleteMemo(memoId: MemoId) { ...@@ -80,7 +80,7 @@ export function deleteMemo(memoId: MemoId) {
return axios.delete(`/api/memo/${memoId}`); return axios.delete(`/api/memo/${memoId}`);
} }
export function getMyShortcuts() { export function getShortcutList() {
return axios.get<ResponseObject<Shortcut[]>>("/api/shortcut"); return axios.get<ResponseObject<Shortcut[]>>("/api/shortcut");
} }
...@@ -99,3 +99,7 @@ export function deleteShortcutById(shortcutId: ShortcutId) { ...@@ -99,3 +99,7 @@ export function deleteShortcutById(shortcutId: ShortcutId) {
export function uploadFile(formData: FormData) { export function uploadFile(formData: FormData) {
return axios.post<ResponseObject<Resource>>("/api/resource", formData); return axios.post<ResponseObject<Resource>>("/api/resource", formData);
} }
export function getTagList() {
return axios.get<ResponseObject<string[]>>("/api/tag");
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
@apply p-0 sm:py-16; @apply p-0 sm:py-16;
> .dialog-container { > .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 { > .dialog-header-container {
@apply flex flex-row justify-between items-center w-full p-6 pb-0 mb-0; @apply flex flex-row justify-between items-center w-full p-6 pb-0 mb-0;
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
} }
> .tip-container { > .tip-container {
@apply m-auto py-4 px-0; @apply m-auto py-6 pb-12 px-0;
> .tip-text { > .tip-text {
font-style: italic; font-style: italic;
......
import * as api from "../helpers/api"; import * as api from "../helpers/api";
import { TAG_REG } from "../helpers/consts";
import { createMemo, patchMemo, setMemos, setTags } from "../store/modules/memo"; import { createMemo, patchMemo, setMemos, setTags } from "../store/modules/memo";
import store from "../store"; import store from "../store";
...@@ -17,7 +16,7 @@ const memoService = { ...@@ -17,7 +16,7 @@ const memoService = {
}, },
fetchAllMemos: async () => { 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)); const memos = data.filter((m) => m.rowStatus !== "ARCHIVED").map((m) => convertResponseModelMemo(m));
store.dispatch(setMemos(memos)); store.dispatch(setMemos(memos));
...@@ -25,7 +24,7 @@ const memoService = { ...@@ -25,7 +24,7 @@ const memoService = {
}, },
fetchDeletedMemos: async () => { fetchDeletedMemos: async () => {
const { data } = (await api.getMyArchivedMemos()).data; const { data } = (await api.getArchivedMemoList()).data;
const deletedMemos = data.map((m) => { const deletedMemos = data.map((m) => {
return convertResponseModelMemo(m); return convertResponseModelMemo(m);
}); });
...@@ -42,16 +41,9 @@ const memoService = { ...@@ -42,16 +41,9 @@ const memoService = {
return null; return null;
}, },
updateTagsState: () => { updateTagsState: async () => {
const { memos } = memoService.getState(); const { data } = (await api.getTagList()).data;
const tagsSet = new Set<string>(); store.dispatch(setTags(data));
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))));
}, },
getLinkedMemos: async (memoId: MemoId): Promise<Memo[]> => { getLinkedMemos: async (memoId: MemoId): Promise<Memo[]> => {
......
...@@ -16,7 +16,7 @@ const shortcutService = { ...@@ -16,7 +16,7 @@ const shortcutService = {
}, },
getMyAllShortcuts: async () => { getMyAllShortcuts: async () => {
const { data } = (await api.getMyShortcuts()).data; const { data } = (await api.getShortcutList()).data;
const shortcuts = data.map((s) => convertResponseModelShortcut(s)); const shortcuts = data.map((s) => convertResponseModelShortcut(s));
store.dispatch(setShortcuts(shortcuts)); store.dispatch(setShortcuts(shortcuts));
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment