collection days
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user