Add table view and split name into firstName/lastName fields
This commit is contained in:
@@ -32,18 +32,19 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
const body = await readBody(event)
|
||||
const { id, name, email, phone, address, notes } = body
|
||||
const { id, firstName, lastName, email, phone, address, notes } = body
|
||||
|
||||
if (!name) {
|
||||
if (!firstName || !lastName) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
message: 'Name ist erforderlich.'
|
||||
message: 'Vorname und Nachname sind erforderlich.'
|
||||
})
|
||||
}
|
||||
|
||||
await saveMember({
|
||||
id: id || undefined,
|
||||
name,
|
||||
firstName,
|
||||
lastName,
|
||||
email: email || '',
|
||||
phone: phone || '',
|
||||
address: address || '',
|
||||
|
||||
Reference in New Issue
Block a user