Merge branch 'feat/sk-31' into 'main'

add all message datatable and alertboxes instead of toast

See merge request jjimenez/safekat!609
This commit is contained in:
Alvaro
2025-03-25 19:15:09 +00:00
10 changed files with 62 additions and 41 deletions

View File

@ -59,10 +59,12 @@ export class ChatDepartmentDatatable {
}
deleteChatDepartmentSuccess(response) {
this.datatable.ajax.reload()
alertSuccess(response.message).fire()
popSuccessAlert(response.message);
}
deleteChatDepartmentError(response) {
alertError(response.message).fire()
popErrorAlert(response.message);
}
storeNewChatDepartment() {
this.btnStoreChatDepartment.attr("disabled")
@ -85,11 +87,12 @@ export class ChatDepartmentDatatable {
}
storeNewChatDepartmentSuccess(response) {
this.datatable.ajax.reload()
alertSuccess(response.message).fire()
popSuccessAlert(response.message);
}
storeNewChatDepartmentError(response) {
console.log(response)
alertError(response.message).fire()
popErrorAlert(response.message);
}
}
@ -147,10 +150,12 @@ export class ChatDepartmentUserDatatable {
}
deleteRowSuccess(response) {
this.datatable.ajax.reload();
alertSuccess(response.message).fire()
popSuccessAlert(response.message);
}
deleteRowError(response) {
alertError(response?.message).fire()
popErrorAlert(response.message);
}

View File

@ -3,7 +3,7 @@ import Ajax from "../ajax.js";
class MessagesDatatable {
constructor(domItem) {
this.item = domItem
this.datatableItem = this.item.find("#tableMessages")
this.datatableItem = this.item.find("#tableAllMessages")
this.datatablePresupuestoMessageItem = this.item.find("#tablePresupuestoMessages")
this.datatablePedidoMessageItem = this.item.find("#tablePedidoMessages")
this.datatableFacturaMessageItem = this.item.find("#tableFacturaMessages")

View File

@ -52,11 +52,11 @@ class ChatDepartmentForm {
_handleUserToDepartmentSuccess(response) {
this.btnAddUserToDepartment.removeAttr("disabled")
this.chatDepartmentUsersDatatable.datatable.ajax.reload()
alertSuccess(response.message).fire()
popSuccessAlert(response.message);
this.seletChatDepartmentUser.reset()
}
_handleUserToDepartmentError(response) {
alertError(response.message ?? "").fire()
popErrorAlert(response.message);
this.btnAddUserToDepartment.removeAttr("disabled")
}
@ -76,12 +76,12 @@ class ChatDepartmentForm {
}
__handleUpdateDepartmentSuccess(response) {
this.btnUpdate.removeAttr("disabled")
alertSuccess(response.message).fire()
popSuccessAlert(response.message);
this.updateFormData(response.data)
}
_handleUpdateDepartmentError(response) {
this.btnUpdate.removeAttr("disabled")
alertError(response.message ?? "").fire()
popErrorAlert(response.message);
}

View File

@ -38,7 +38,7 @@ class MessagePage {
this.btnSubmitNewDirectMessage.on("click", this.handleSubmitNewMessage.bind(this))
this.btnSubmitNewDirectMessageCliente.on("click", this.handleSubmitNewMessageClient.bind(this))
$("#navs-top-align-directos-tab").on("click",()=>{
$("#navs-top-align-all-tab").on("click",()=>{
this.messageDatatable.datatable.ajax.reload()
})
$("#navs-top-align-presupuestos-tab").on("click",()=>{