Add nanoid
This commit is contained in:
parent
e081ed622a
commit
3599bc2b60
50 changed files with 1803 additions and 377 deletions
|
|
@ -51,3 +51,13 @@ export const deleteNote = async (noteId: number): Promise<void> => {
|
|||
|
||||
await handleAuthResponse(response, 'Failed to delete note.');
|
||||
};
|
||||
|
||||
export const fetchNoteBySlug = async (nanoidSlug: string): Promise<Note> => {
|
||||
const response = await fetch(`/api/note/${nanoidSlug}`, {
|
||||
credentials: 'include',
|
||||
headers: getDefaultHeaders(),
|
||||
});
|
||||
|
||||
await handleAuthResponse(response, 'Failed to fetch note.');
|
||||
return await response.json();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue