Skip to content

Commit

Permalink
Hotfix #98
Browse files Browse the repository at this point in the history
This commit is fixing the error notification when creating a task. This is a fix for issue #98
  • Loading branch information
bepitulaz committed Dec 24, 2019
1 parent ca2028b commit 966c9e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/js/pages/farms/tasks/crop-task-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default {
this.task.domain = "CROP"
this.submitTask(this.task)
.then(() => this.$parent.$emit('close'))
.catch(() => this.$toasted.error('Error in task submission'))
.catch(() => this.$toasted.error('Task due date cannot be earlier than the current date.'))

This comment has been minimized.

Copy link
@Citrullin

Citrullin Dec 30, 2019

I am not familiar with the code. But this looks like: Catch them all. What, if there is another error?

This comment has been minimized.

Copy link
@bepitulaz

bepitulaz Jan 19, 2020

Author Member

@Citrullin Me too not really familiar with Vue. I'm not the one who wrote the front-end code, but I think you're correct because the backend code actually can throw some error codes. I'll find how to catch all backend errors for this one.

},
openPicker () {
this.$refs.openCal.showCalendar()
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/farms/tasks/task-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default {
}
this.submitTask(this.task)
.then(() => this.$parent.$emit('close'))
.catch(() => this.$toasted.error('Error in task submission'));
.catch(() => this.$toasted.error('Task due date cannot be earlier than the current date.'));
},
},
};
Expand Down

0 comments on commit 966c9e6

Please sign in to comment.