frontend cleanup
This commit is contained in:
@@ -32,10 +32,10 @@ export const actions = {
|
||||
const rawData = formDataToObject(formData);
|
||||
const processedData = processFormData(rawData);
|
||||
|
||||
console.dir(processedData.user.membership);
|
||||
const isCreating = !processedData.user.id || processedData.user.id === 0;
|
||||
console.log('Is updating: ', isCreating);
|
||||
console.dir(formData);
|
||||
console.log('Is creating: ', isCreating);
|
||||
// console.dir(formData);
|
||||
console.dir(processedData.user.membership);
|
||||
const apiURL = `${BASE_API_URI}/backend/users/update/`;
|
||||
|
||||
/** @type {RequestInit} */
|
||||
|
||||
@@ -86,7 +86,14 @@
|
||||
|
||||
{#if showModal}
|
||||
<Modal on:close={close}>
|
||||
<UserEditForm {form} {user} {subscriptions} {licence_categories} on:cancel={close} />
|
||||
<UserEditForm
|
||||
{form}
|
||||
{user}
|
||||
{subscriptions}
|
||||
{licence_categories}
|
||||
on:close={close}
|
||||
on:cancel={close}
|
||||
/>
|
||||
</Modal>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { fail, redirect } from '@sveltejs/kit';
|
||||
import { formDataToObject, processFormData } from '$lib/utils/processing';
|
||||
|
||||
/** @type {import('./$types').PageServerLoad} */
|
||||
export async function load({ locals, params }) {
|
||||
export async function load({ locals }) {
|
||||
// redirect user if not logged in
|
||||
if (!locals.user) {
|
||||
throw redirect(302, `/auth/login?next=/auth/users`);
|
||||
|
||||
@@ -7,13 +7,7 @@
|
||||
/** @type {import('./$types').ActionData} */
|
||||
export let form;
|
||||
|
||||
$: ({
|
||||
user,
|
||||
users = [],
|
||||
licence_categories = [],
|
||||
subscriptions = [],
|
||||
payments = []
|
||||
} = $page.data);
|
||||
$: ({ users = [], licence_categories = [], subscriptions = [], payments = [] } = $page.data);
|
||||
|
||||
let activeSection = 'users';
|
||||
/** @type{App.Locals['user'] | null} */
|
||||
|
||||
Reference in New Issue
Block a user