#7825: Fill the bank field when a new entity is created #798

Merged
jon merged 3 commits from 7825-FixCreatebankEntity into dev 2024-10-15 11:42:39 +00:00
1 changed files with 9 additions and 1 deletions
Showing only changes of commit 4b9588c189 - Show all commits

View File

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