aboutsummaryrefslogtreecommitdiffstats
path: root/sampleconfig/lnd
diff options
context:
space:
mode:
Diffstat (limited to 'sampleconfig/lnd')
0 files changed, 0 insertions, 0 deletions
>13 14 15 16
import { fail, redirect } from "@sveltejs/kit";
import { fd, auth, post } from "$lib/utils";

export const actions = {
	default: async ({ cookies, request, url }) => {
		const form = await fd(request);
		try {
			await post("/items", form, auth(cookies));
		} catch (e: any) {
			return fail(400, { message: e.message });
		}

		const success = `/${url.pathname.split("/")[1]}`;
		redirect(307, success);
	},
};