mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-04 00:20:39 +00:00
prefix api
This commit is contained in:
@@ -14,7 +14,7 @@ export type NotePublic = Pick<Note, 'contents'>
|
||||
|
||||
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
|
||||
|
@@ -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}
|
||||
<form on:submit|preventDefault={submit}>
|
||||
<fieldset disabled={loading}>
|
||||
<TextArea label="note" bind:value={note.contents} />
|
||||
<TextArea label="note" bind:value={note.contents} placeholder="..." />
|
||||
|
||||
<div class="bottom">
|
||||
<Switch label="advanced" bind:value={advanced} />
|
||||
|
Reference in New Issue
Block a user