move API routes as cleanup
This commit is contained in:
@@ -1,10 +1 @@
|
||||
<script lang="ts">
|
||||
import Header from "$lib/components/Header.svelte";
|
||||
</script>
|
||||
|
||||
<Header>
|
||||
<ul class=site_header slot=links>
|
||||
<li><a href="/">Home</a></li>
|
||||
</ul>
|
||||
|
||||
</Header>
|
||||
<h1>WIP</h1>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const load: PageServerLoad = async ({ locals }) => {
|
||||
export const actions: Actions = {
|
||||
login: async (event) => {
|
||||
const data = await event.request.formData()
|
||||
const res = await event.fetch('/api/login',
|
||||
const res = await event.fetch('/api/user/login',
|
||||
{method: 'POST',
|
||||
body: JSON.stringify({
|
||||
username: data.get('username'),
|
||||
|
||||
@@ -10,7 +10,7 @@ export const load: PageServerLoad = async ({ locals }) => {
|
||||
export const actions: Actions = {
|
||||
register: async (event) => {
|
||||
const data = await event.request.formData();
|
||||
const res = await event.fetch('/api/register',
|
||||
const res = await event.fetch('/api/user/register',
|
||||
{method: 'POST',
|
||||
body: JSON.stringify({
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const actions: Actions = {
|
||||
},
|
||||
login: async (event) => {
|
||||
const data = await event.request.formData()
|
||||
const res = await event.fetch('/api/login',
|
||||
const res = await event.fetch('/api/user/login',
|
||||
{method: 'POST',
|
||||
body: JSON.stringify({
|
||||
username: data.get('username'),
|
||||
|
||||
Reference in New Issue
Block a user