Compare commits
2 commits
ccbbfd1d3b
...
500a9ad595
Author | SHA1 | Date | |
---|---|---|---|
500a9ad595 | |||
f5b205f90c |
2 changed files with 8 additions and 8 deletions
|
@ -55,10 +55,10 @@ function updatePagedListVModel(element: Array<string>) {
|
||||||
const editMode = ref<boolean>(route.query?.edit === "1");
|
const editMode = ref<boolean>(route.query?.edit === "1");
|
||||||
function editorFields(): Array<fieldDefinition> {
|
function editorFields(): Array<fieldDefinition> {
|
||||||
return [
|
return [
|
||||||
{ key: "name", type: "text", label: "Name", value: client.value.name ?? undefined },
|
{ key: "name", type: "text", label: "Name", value: client.value.name ?? "" },
|
||||||
{ key: "address", type: "text", label: "Address", value: client.value.address ?? undefined },
|
{ key: "address", type: "text", label: "Address", value: client.value.address ?? "" },
|
||||||
{ key: "phone", type: "text", label: "Phone", value: client.value.phone ?? undefined },
|
{ key: "phone", type: "text", label: "Phone", value: client.value.phone ?? "" },
|
||||||
{ key: "email", type: "text", label: "E-mail", value: client.value.email ?? undefined },
|
{ key: "email", type: "text", label: "E-mail", value: client.value.email ?? "" },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ export function checkIsClient<Patch extends boolean = boolean>(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(typeof value.name === "string" || value.name === null || (!patch && value.name === undefined))) errors.set("name", "is not string or null");
|
if (!(typeof value.name === "string" || value.name === null || (patch && value.name === undefined))) errors.set("name", "is not string or null");
|
||||||
if (!(typeof value.address === "string" || value.address === null || (!patch && value.address === undefined))) errors.set("address", "is not string or null");
|
if (!(typeof value.address === "string" || value.address === null || (patch && value.address === undefined))) errors.set("address", "is not string or null");
|
||||||
if (!(typeof value.phone === "string" || value.phone === null || (!patch && value.phone === undefined))) errors.set("phone", "is not string or null");
|
if (!(typeof value.phone === "string" || value.phone === null || (patch && value.phone === undefined))) errors.set("phone", "is not string or null");
|
||||||
if (!(typeof value.email === "string" || value.email === null || (!patch && value.email === undefined))) errors.set("email", "is not string or null");
|
if (!(typeof value.email === "string" || value.email === null || (patch && value.email === undefined))) errors.set("email", "is not string or null");
|
||||||
|
|
||||||
for (const i in value as Partial<Omit<Client, "id">>)
|
for (const i in value as Partial<Omit<Client, "id">>)
|
||||||
if (!clientKeys.includes(i)) errors.set(i, `excessive property`);
|
if (!clientKeys.includes(i)) errors.set(i, `excessive property`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue