i`
This commit is contained in:
@@ -192,10 +192,11 @@ document.addEventListener('alpine:init', () => {
|
||||
async save() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const payload = { ...this.form, precio: parseFloat(this.form.precio) || 0 };
|
||||
if (this.editModal) {
|
||||
await axios.put(`/app/api/servicios/${this.selectedId}`, this.form);
|
||||
await axios.put(`/app/api/servicios/${this.selectedId}`, payload);
|
||||
} else {
|
||||
await axios.post('/app/api/servicios', this.form);
|
||||
await axios.post('/app/api/servicios', payload);
|
||||
}
|
||||
this.showToast('Guardado correctamente');
|
||||
this.closeModals();
|
||||
|
||||
Reference in New Issue
Block a user