add: driverslicence update
This commit is contained in:
2
frontend/src/app.d.ts
vendored
2
frontend/src/app.d.ts
vendored
@@ -36,7 +36,7 @@ interface DriversLicence {
|
|||||||
licence_number: string | "";
|
licence_number: string | "";
|
||||||
issued_date: string | "";
|
issued_date: string | "";
|
||||||
expiration_date: string | "";
|
expiration_date: string | "";
|
||||||
issuing_country: string | "";
|
country: string | "";
|
||||||
licence_categories: LicenceCategory[];
|
licence_categories: LicenceCategory[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,20 @@ export const actions = {
|
|||||||
bic: String(formData.get("bic")),
|
bic: String(formData.get("bic")),
|
||||||
mandate_reference: String(formData.get("mandate_reference")),
|
mandate_reference: String(formData.get("mandate_reference")),
|
||||||
},
|
},
|
||||||
|
drivers_licence: {
|
||||||
|
id: Number(formData.get("drivers_licence_id")),
|
||||||
|
status: Number(formData.get("licence_status")),
|
||||||
|
licence_number: String(formData.get("licence_number")),
|
||||||
|
issued_date: toRFC3339(formData.get("issued_date")),
|
||||||
|
expiration_date: toRFC3339(formData.get("expiration_date")),
|
||||||
|
country: String(formData.get("country")),
|
||||||
|
licence_categories: formData
|
||||||
|
.getAll("licence_categories[]")
|
||||||
|
.map((category) => ({
|
||||||
|
id: -1, // Use -1 as a placeholder for new categories
|
||||||
|
category: String(category),
|
||||||
|
})),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Remove undefined or null properties
|
// Remove undefined or null properties
|
||||||
|
|||||||
@@ -467,7 +467,7 @@
|
|||||||
<InputField
|
<InputField
|
||||||
name="country"
|
name="country"
|
||||||
label={$t("country")}
|
label={$t("country")}
|
||||||
bind:value={user.drivers_licence.issuing_country}
|
bind:value={user.drivers_licence.country}
|
||||||
placeholder={$t("placeholder.issuing_country")}
|
placeholder={$t("placeholder.issuing_country")}
|
||||||
/>
|
/>
|
||||||
<div class="licence-categories">
|
<div class="licence-categories">
|
||||||
|
|||||||
Reference in New Issue
Block a user