Skip to content

Commit

Permalink
feat: error message added to the modal instead of the toast one
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-in-kiva committed Nov 17, 2023
1 parent cfbaed1 commit 53a5dcb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/Portfolio/ImpactDashboard/LoanCommentModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
>
Save
</kv-button>
<p v-if="showError" class="tw-mt-1 tw-text-small tw-text-danger">
There was a problem commenting on this loan, try again please.
</p>
</kv-lightbox>
</template>

Expand Down Expand Up @@ -67,6 +70,7 @@ export default {
mdiPencilOutline,
userComment: '',
loading: false,
showError: false,
};
},
computed: {
Expand All @@ -85,6 +89,7 @@ export default {
methods: {
submitComment() {
this.loading = true;
this.showError = false;
this.apollo.mutate({
mutation: loanAddComment,
variables: {
Expand All @@ -102,8 +107,8 @@ export default {
throw new Error('Comment not added');
}
}).catch(e => {
this.showError = true;
logFormatter(e, 'error');
this.$showTipMsg('There was a problem commenting on this loan', 'error');
}).finally(() => {
this.loading = false;
});
Expand Down

0 comments on commit 53a5dcb

Please sign in to comment.