From c869238171d1438302272d0ed5b63e01c01a9ebf Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 2 May 2021 14:02:40 +0200 Subject: [PATCH] prefix api --- client/src/lib/api.ts | 6 +++--- client/src/lib/views/Create.svelte | 4 ++-- docker-compose.yml | 3 +++ src/note/routes.rs | 14 ++++++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/client/src/lib/api.ts b/client/src/lib/api.ts index fa61aca..aa89a89 100644 --- a/client/src/lib/api.ts +++ b/client/src/lib/api.ts @@ -14,7 +14,7 @@ export type NotePublic = Pick export async function create(note: Note) { const { data } = await base({ - url: '/notes/', + url: '/api/notes', method: 'post', data: note, }) @@ -23,7 +23,7 @@ export async function create(note: Note) { export async function get(id: string) { const { data } = await base({ - url: `/notes/${id}`, + url: `/api/notes/${id}`, method: 'delete', }) return data as NotePublic @@ -31,7 +31,7 @@ export async function get(id: string) { export async function info(id: string) { const { data } = await base({ - url: `/notes/${id}`, + url: `/api/notes/${id}`, method: 'get', }) return data as NoteInfo diff --git a/client/src/lib/views/Create.svelte b/client/src/lib/views/Create.svelte index 39b1f4b..69bfa93 100644 --- a/client/src/lib/views/Create.svelte +++ b/client/src/lib/views/Create.svelte @@ -9,7 +9,7 @@ import TextInput from '$lib/ui/TextInput.svelte' let note: Note = { - contents: 'secret', + contents: '', password: false, views: 1, expiration: 60, @@ -74,7 +74,7 @@ {:else}
-