collection days

This commit is contained in:
Sean Morley
2024-07-27 14:26:15 -04:00
parent 055290ce3f
commit c94a4379c7
8 changed files with 101 additions and 5 deletions

View File

@@ -51,6 +51,8 @@ export const actions: Actions = {
const name = formData.get('name') as string;
const description = formData.get('description') as string | null;
const start_date = formData.get('start_date') as string | null;
const end_date = formData.get('end_date') as string | null;
if (!name) {
return {
@@ -62,6 +64,8 @@ export const actions: Actions = {
const formDataToSend = new FormData();
formDataToSend.append('name', name);
formDataToSend.append('description', description || '');
formDataToSend.append('start_date', start_date || '');
formDataToSend.append('end_date', end_date || '');
let auth = event.cookies.get('auth');
if (!auth) {
@@ -136,6 +140,8 @@ export const actions: Actions = {
const name = formData.get('name') as string;
const description = formData.get('description') as string | null;
let is_public = formData.get('is_public') as string | null | boolean;
const start_date = formData.get('start_date') as string | null;
const end_date = formData.get('end_date') as string | null;
if (is_public) {
is_public = true;
@@ -154,6 +160,8 @@ export const actions: Actions = {
formDataToSend.append('name', name);
formDataToSend.append('description', description || '');
formDataToSend.append('is_public', is_public.toString());
formDataToSend.append('start_date', start_date || '');
formDataToSend.append('end_date', end_date || '');
let auth = event.cookies.get('auth');