Jelajahi Sumber

add no mealslot warning

tripeur 4 tahun lalu
induk
melakukan
66ce7012a8
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      src/PlannerApp.vue

+ 7 - 0
src/PlannerApp.vue

@@ -313,6 +313,13 @@ export default defineComponent({
       const slots = this.$store.state.creneauList.filter((o) => !o.isMeal);
       const timeslots = slots.map((o) => o.toTimeslotRaw());
       const mealSlots = meals.map((o) => o.toMealSlot());
+      if (mealSlots.length == 0) {
+        toast({
+          html: "Vous devez avoir au moins 1 creneau bouffe dans votre planning.",
+          classes: "error",
+        });
+        return;
+      }
       const volonteerList = this.$store.state.benevoleList
         .filter((b) => !b.isFixed)
         .map((b) => b.toVolonteeRaw());