From 969cbe9ad862fee329789cc5787c1c35543ba276 Mon Sep 17 00:00:00 2001 From: Loduis Madariaga Barrios Date: Sun, 12 Jan 2025 05:02:58 -0500 Subject: [PATCH] fix: update company info on array of companies. (#227) --- resources/scripts/admin/stores/company.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/scripts/admin/stores/company.js b/resources/scripts/admin/stores/company.js index 1e10489b..9dfeb56c 100644 --- a/resources/scripts/admin/stores/company.js +++ b/resources/scripts/admin/stores/company.js @@ -51,7 +51,10 @@ export const useCompanyStore = (useWindow = false) => { }) this.selectedCompany = response.data.data - + const companyIndex = this.companies.findIndex((company) => company.unique_hash === this.selectedCompany.unique_hash); + if (companyIndex !== -1) { + this.companies[companyIndex] = this.selectedCompany; + } resolve(response) }) .catch((err) => {