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