This commit is contained in:
Lizandro Guarnizo
2026-04-30 21:52:12 -05:00
parent aa393fce98
commit 7be96ad491
3 changed files with 18 additions and 6 deletions
+7 -2
View File
@@ -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();