mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Trim inputs in 'Form'
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
/* let state: State = { status: Status.Signing }; */
|
||||
let state: State = { status: Status.Failed, error: "Error registering, something happened." };
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
@@ -67,14 +67,13 @@
|
||||
});
|
||||
});
|
||||
|
||||
const onSave = async (event: { detail: Field[] }) => {
|
||||
const onSave = async (event: { detail: { name: string; value: string | null }[] }) => {
|
||||
assert(state.status === Status.Found, "registration must be found");
|
||||
|
||||
updateRecords = event.detail
|
||||
.filter(r => r.editable && r.value !== null)
|
||||
.filter(f => f.value !== null)
|
||||
.map(f => {
|
||||
assert(f.value !== null);
|
||||
return { name: f.name, value: f.value };
|
||||
return { name: f.name, value: f.value as string };
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user