Skip to content

Commit

Permalink
fix minor issues and refine some code.
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-webkul committed Nov 11, 2024
1 parent adc617f commit 73d3662
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,14 @@ class="dark:mix-blend-exclusion dark:invert"
this.$axios.put("{{ route('admin.activities.update', 'replaceId') }}".replace('replaceId', activity.id), {
'is_done': 1
})
.then ((response) => {
.then((response) => {
this.isUpdating[activity.id] = false;
activity.is_done = 1;
this.$emitter.emit('add-flash', { type: 'success', message: response.data.message });
})
.catch ((error) => {
.catch((error) => {
this.isUpdating[activity.id] = false;
this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.message });
Expand All @@ -587,14 +587,14 @@ class="dark:mix-blend-exclusion dark:invert"
this.isUpdating[activity.id] = true;
this.$axios.delete("{{ route('admin.activities.delete', 'replaceId') }}".replace('replaceId', activity.id))
.then ((response) => {
.then((response) => {
this.isUpdating[activity.id] = false;
this.activities.splice(this.activities.indexOf(activity), 1);
this.$emitter.emit('add-flash', { type: 'success', message: response.data.message });
})
.catch (function (error) {
.catch((error) => {
this.isUpdating[activity.id] = false;
this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.message });
Expand All @@ -613,7 +613,7 @@ class="dark:mix-blend-exclusion dark:invert"
email_id: emailId,
}
})
.then (response => {
.then((response) => {
let relatedActivities = this.activities.filter(activity => activity.parent_id == emailId || activity.id == emailId);
relatedActivities.forEach(activity => {
Expand All @@ -626,8 +626,8 @@ class="dark:mix-blend-exclusion dark:invert"
this.$emitter.emit('add-flash', { type: 'success', message: response.data.message });
})
.catch (error => {
this.$emitter.emit('add-flash', { type: 'success', message: response.data.message });
.catch((error) => {
this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.message });
});
}
});
Expand Down

0 comments on commit 73d3662

Please sign in to comment.