0
0
Fork 0

refactor: refs #7825 modified worker list form to fill the field when a bank entity is created

This commit is contained in:
Jon Elias 2024-10-04 08:55:48 +02:00
parent c78e816f0c
commit 4b9588c189
1 changed files with 9 additions and 1 deletions

View File

@ -93,6 +93,11 @@ onBeforeMount(async () => {
).data?.payMethodFk; ).data?.payMethodFk;
}); });
const handleNewBankEntity = (response, formData) => {
bankEntitiesOptions.value = [...bankEntitiesOptions.value, response];
formData.bankEntityFk = response.id;
};
function handleLocation(data, location) { function handleLocation(data, location) {
const { town, code, provinceFk, countryFk } = location ?? {}; const { town, code, provinceFk, countryFk } = location ?? {};
data.postcode = code; data.postcode = code;
@ -319,7 +324,10 @@ async function autofillBic(worker) {
> >
<template #form> <template #form>
<CreateBankEntityForm <CreateBankEntityForm
@on-data-saved="(data) => bankEntitiesOptions.push(data)" @on-data-saved="
(_, requestResponse) =>
handleNewBankEntity(requestResponse, data)
"
/> />
</template> </template>
<template #option="scope"> <template #option="scope">