mirror of
https://github.com/thiloho/archtika.git
synced 2025-12-24 15:23:36 +01:00
Explicitely define server load and action types
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
export const load = async ({ locals }) => {
|
||||
import type { Actions, PageServerLoad } from "./$types";
|
||||
|
||||
export const load: PageServerLoad = async ({ locals }) => {
|
||||
return {
|
||||
user: locals.user
|
||||
};
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
export const actions: Actions = {
|
||||
logout: async ({ cookies }) => {
|
||||
cookies.delete("session_token", { path: "/" });
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
import { enhance } from "$app/forms";
|
||||
import Modal from "$lib/components/Modal.svelte";
|
||||
import SuccessOrError from "$lib/components/SuccessOrError.svelte";
|
||||
import type { ActionData, PageServerData } from "./$types";
|
||||
|
||||
const { data, form } = $props();
|
||||
const { data, form } = $props<{ data: PageServerData; form: ActionData }>();
|
||||
</script>
|
||||
|
||||
<SuccessOrError success={form?.success} message={form?.message} />
|
||||
|
||||
Reference in New Issue
Block a user