Skip to content

Commit

Permalink
Fix mark as accepted not updating state
Browse files Browse the repository at this point in the history
  • Loading branch information
yashkanakiya authored and mohitpanjwani committed Dec 1, 2021
1 parent e1ef208 commit d839962
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions resources/scripts/stores/estimate.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,19 @@ export const useEstimateStore = (useWindow = false) => {
axios
.post(`/api/v1/estimates/${data.id}/status`, data)
.then((response) => {
const notificationStore = useNotificationStore()
let pos = this.estimates.findIndex(
(estimate) => estimate.id === data.id
)
if (this.estimates[pos]) {
this.estimates[pos].status = 'ACCEPTED'

notificationStore.showNotification({
type: 'success',
message: global.t('estimates.marked_as_accepted_message'),
})
const notificationStore = useNotificationStore()

notificationStore.showNotification({
type: 'success',
message: global.t('estimates.marked_as_accepted_message'),
})
}
resolve(response)
})
.catch((err) => {
Expand Down

0 comments on commit d839962

Please sign in to comment.