Skip to content

Commit

Permalink
Merge pull request #670 from R-Sourabh/#669-no-facility-associated-toast
Browse files Browse the repository at this point in the history
Improved: Added a check to show a toast when no facility is associated with the user (#669)
  • Loading branch information
ymaheshwari1 authored Feb 5, 2025
2 parents 8f1f373 + 5b02c81 commit 6471fa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"No data found": "No data found",
"No facility found.": "No facility found.",
"No facility group found.": "No facility group found.",
"No facility is associated with this user": "No facility is associated with this user",
"No items found": "No items found",
"No items added to count": "No items added to count",
"No new file upload. Please try again.": "No new file upload. Please try again.",
Expand Down
6 changes: 5 additions & 1 deletion src/views/Count.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ import { translate } from '@/i18n';
import { computed, ref } from "vue";
import { useStore } from 'vuex';
import { useRouter } from 'vue-router'
import { getCycleCountStats, getDateWithOrdinalSuffix } from "@/utils"
import { getCycleCountStats, getDateWithOrdinalSuffix, showToast } from "@/utils"
const store = useStore();
const router = useRouter()
Expand Down Expand Up @@ -224,6 +224,10 @@ async function loadMoreCycleCount(event) {
}
async function fetchCycleCounts(vSize, vIndex) {
if(!currentFacility.value?.facilityId) {
showToast(translate("No facility is associated with this user"));
return;
}
const pageSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE;
const pageIndex = vIndex ? vIndex : 0;
const facilityId = currentFacility.value?.facilityId
Expand Down

0 comments on commit 6471fa5

Please sign in to comment.