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