diff --git a/app/components/IconTitle.vue b/app/components/IconTitle.vue new file mode 100644 index 0000000..ab2ff7e --- /dev/null +++ b/app/components/IconTitle.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/app/components/PageHeader.vue b/app/components/PageHeader.vue index 97ac976..7ce8abf 100644 --- a/app/components/PageHeader.vue +++ b/app/components/PageHeader.vue @@ -26,6 +26,13 @@ + + Account + + +
+ +
+ + + diff --git a/app/pages/account.vue b/app/pages/account.vue new file mode 100644 index 0000000..1fd0268 --- /dev/null +++ b/app/pages/account.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/app/pages/index.vue b/app/pages/index.vue index 72eb43d..2feba6b 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,12 +1,6 @@ @@ -14,15 +8,12 @@ definePageMeta({ layout: 'page' }) - - const { user } = useUserStore() diff --git a/server/api/account/index.delete.ts b/server/api/account/index.delete.ts new file mode 100644 index 0000000..12646a5 --- /dev/null +++ b/server/api/account/index.delete.ts @@ -0,0 +1,15 @@ +import { and, eq } from 'drizzle-orm' + +export default defineEventHandler(async (event) => { + const userId = await validateSessionUser(event) + + await event.context.db + .delete(tables.users) + .where( + and( + eq(tables.users.id, userId) + ) + ) + + setResponseStatus(event, 204) +}) diff --git a/server/database/schema.ts b/server/database/schema.ts index 0760318..05d0e10 100644 --- a/server/database/schema.ts +++ b/server/database/schema.ts @@ -281,7 +281,7 @@ export const equipment = pgTable('equipment', { check( 'equipment_description_check', sql.raw(`char_length(description) <= ${limits.maxEquipmentDescriptionLength}`) - ), + ) ]) /**