This commit is contained in:
parent
0199557463
commit
23d1791193
|
@ -149,7 +149,6 @@ const submitForm = async (evt) => {
|
|||
await save(evt);
|
||||
}
|
||||
};
|
||||
const mapper = toRef($props, 'mapper');
|
||||
|
||||
onMounted(async () => {
|
||||
nextTick(() => (componentIsRendered.value = true));
|
||||
|
@ -234,7 +233,7 @@ async function fetch() {
|
|||
}
|
||||
|
||||
async function handleResponse(promise) {
|
||||
const response = await Promise.allSettled([promise]);
|
||||
const [response] = await Promise.all([promise]);
|
||||
updateAndEmit('onDataSaved', {
|
||||
val: formData.value,
|
||||
res: response?.data,
|
||||
|
@ -254,8 +253,8 @@ async function create() {
|
|||
}
|
||||
|
||||
async function update() {
|
||||
const body = mapper.value
|
||||
? mapper.value(originalData.value, formData.value)
|
||||
const body = $props.mapper
|
||||
? $props.mapper(originalData.value, formData.value)
|
||||
: formData.value;
|
||||
const url = $props.urlUpdate || $props.url || arrayData.store.url;
|
||||
const promise = $props.saveFn ? $props.saveFn(body) : axios.patch(url, body);
|
||||
|
|
Loading…
Reference in New Issue