mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
Добавили заметки в сайдбар (#126)
* added notes sidebar * added note dropping and editing * added sidebar navigation * handling sidebarchanges over time * using router back for closing sidebar * fixed tripping inside single sidebar * added superpowers toggle to sidebar * user button opens sidebar now * added profile cover for profile sidebar * removed profile sidebar completely * ran prettier over project * added note not found error literal
This commit is contained in:
parent
fe3db608d6
commit
5d34090238
72 changed files with 1241 additions and 664 deletions
|
@ -1,8 +1,31 @@
|
|||
import { ApiGetNotesRequest, ApiGetNotesResponse } from '~/api/notes/types';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { api, cleanResult } from '~/utils/api';
|
||||
import {
|
||||
ApiGetNotesRequest as ApiListNotesRequest,
|
||||
ApiGetNotesResponse,
|
||||
ApiCreateNoteRequest,
|
||||
ApiUpdateNoteResponse,
|
||||
ApiUpdateNoteRequest,
|
||||
} from "~/api/notes/types";
|
||||
import { URLS } from "~/constants/urls";
|
||||
import { api, cleanResult } from "~/utils/api";
|
||||
|
||||
export const apiGetNotes = ({ limit, offset, search }: ApiGetNotesRequest) =>
|
||||
export const apiListNotes = ({ limit, offset, search }: ApiListNotesRequest) =>
|
||||
api
|
||||
.get<ApiGetNotesResponse>(URLS.NOTES, { params: { limit, offset, search } })
|
||||
.then(cleanResult);
|
||||
|
||||
export const apiCreateNote = ({ text }: ApiCreateNoteRequest) =>
|
||||
api
|
||||
.post<ApiUpdateNoteResponse>(URLS.NOTES, {
|
||||
text,
|
||||
})
|
||||
.then(cleanResult);
|
||||
|
||||
export const apiDeleteNote = (id: number) =>
|
||||
api.delete(URLS.NOTE(id)).then(cleanResult);
|
||||
|
||||
export const apiUpdateNote = ({ id, text }: ApiUpdateNoteRequest) =>
|
||||
api
|
||||
.put<ApiUpdateNoteResponse>(URLS.NOTE(id), {
|
||||
content: text,
|
||||
})
|
||||
.then(cleanResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue