diff --git a/src/routes/mypass/edit/+page.server.ts b/src/routes/mypass/edit/+page.server.ts
index 7990d68..9acda2f 100644
--- a/src/routes/mypass/edit/+page.server.ts
+++ b/src/routes/mypass/edit/+page.server.ts
@@ -14,9 +14,9 @@ const profileSchema = z.object({
.max(250, { message: 'Bio must be less than 250 characters' })
.trim()
.optional(),
- fav_stream: z.string().max(100).optional(),
- badge_ids: z.array(z.number().max(100)).max(100).optional(),
- talent_ids: z.array(z.number().max(100)).max(100).optional()
+ fav_stream: z.string().max(256).optional(),
+ badge_ids: z.array(z.number()).optional(),
+ talent_ids: z.array(z.number()).optional()
});
export const load = (async ({ locals }) => {
@@ -40,7 +40,11 @@ export const load = (async ({ locals }) => {
return {};
}
- const { data: talents, error: error2 } = await supabase.from('talents').select('*');
+ const { data: talents, error: error2 } = (
+ await supabase.from('talents')
+ .select('*')
+ .order('sort_order', { ascending: true })
+ );
if (error2) {
console.error('error2', error);
diff --git a/src/routes/mypass/edit/+page.svelte b/src/routes/mypass/edit/+page.svelte
index 6266694..1f7b95e 100644
--- a/src/routes/mypass/edit/+page.svelte
+++ b/src/routes/mypass/edit/+page.svelte
@@ -2,12 +2,12 @@
import { fade } from 'svelte/transition';
import Avatar from '$lib/components/Avatar.svelte';
- import type { PageData } from './$types';
+ import type { ActionData, PageData } from './$types';
import type { Talent } from '../../../custom';
import FormTextInput from '$lib/components/FormTextInput.svelte';
interface Props {
- form: any;
+ form: ActionData;
data: PageData;
}
@@ -158,6 +158,14 @@
+ {#if !form?.success && form?.errors !== undefined}
+
+ {#each Object.entries(form.errors) as [field, message]}
+ - {field}: {message}
+ {/each}
+
+ {/if}
+