diff --git a/app/components/cycle/CycleForm.vue b/app/components/cycle/CycleForm.vue index ad81bec..0c0c218 100644 --- a/app/components/cycle/CycleForm.vue +++ b/app/components/cycle/CycleForm.vue @@ -19,7 +19,10 @@ const state = reactive({ const create = async () => useApi() .setForm(form?.value) - .api>(`/api/user/${route.params.user}/cycle`, { method: 'POST', body: { ...state, date: new Date(`${state.date}T00:00:)0`).toISOString() } }) + .api>(`/api/user/${route.params.user}/cycle`, { + method: 'POST', + body: { ...state, date: new Date(`${state.date}T00:00:00`).toISOString() }, + }) .then(() => emit('created')) diff --git a/app/components/header/HeaderMain.vue b/app/components/header/HeaderMain.vue index eace2ab..9f66575 100644 --- a/app/components/header/HeaderMain.vue +++ b/app/components/header/HeaderMain.vue @@ -47,13 +47,15 @@ const links = [
-
- - - - -
-
+ +
+ + + + +
+
+
diff --git a/server/controllers/cycle.ts b/server/controllers/cycle.ts index e34b866..cbf963d 100644 --- a/server/controllers/cycle.ts +++ b/server/controllers/cycle.ts @@ -5,6 +5,7 @@ import { cartridgeContents } from '~/utils/shared' import { cycle as policies } from '../policies/cycle' const create = async ({ user }: { user: User }, event: H3Event) => { + console.log('cycle.create') const { user: authed } = await requireUserSession(event) authorize(policies.create, { authed }) const schema = z.object({ @@ -21,6 +22,7 @@ const create = async ({ user }: { user: User }, event: H3Event) => { payload.cycles = [] payload.cycles?.push(parsed.data) + console.log('we got right before metapi().success') return metapi().success('cycle created', await usePrisma(event).user.update({ data: { payload: JSON.stringify(payload), diff --git a/server/lib/api.ts b/server/lib/api.ts index b9660ee..dbbfb29 100644 --- a/server/lib/api.ts +++ b/server/lib/api.ts @@ -46,6 +46,7 @@ function modelBoundHandler>( handler: (models: T, event: H3Event) => Promise, ) { return defineEventHandler(async (event: H3Event) => { + console.log('modelNames', modelNames) const boundModels = await lookupModels(modelNames, event) return handler(boundModels, event) })