diff --git a/src/Mealz/MealBundle/Controller/ParticipantController.php b/src/Mealz/MealBundle/Controller/ParticipantController.php
index 613f46577..6ea11ffed 100644
--- a/src/Mealz/MealBundle/Controller/ParticipantController.php
+++ b/src/Mealz/MealBundle/Controller/ParticipantController.php
@@ -377,6 +377,24 @@ public function getProfilesWithoutParticipation(Week $week): JsonResponse
return new JsonResponse($response, 200);
}
+ /**
+ * Returns the dishes for a combi meal of a participant.
+ */
+ public function getCombiForMeal(Meal $meal): JsonResponse
+ {
+ $profile = $this->getProfile();
+ if (null === $profile) {
+ return new JsonResponse(null, 403);
+ }
+
+ $participant = $meal->getParticipant($profile);
+ if (null === $participant) {
+ return new JsonResponse(['message' => 'No participation found'], 404);
+ }
+
+ return new JsonResponse($participant->getCombinedDishes()->toArray(), 200);
+ }
+
private function generateResponse(string $route, string $action, Participant $participant): JsonResponse
{
return new JsonResponse([
diff --git a/src/Mealz/MealBundle/Resources/config/routing.yml b/src/Mealz/MealBundle/Resources/config/routing.yml
index a903e77c3..40effdc8c 100644
--- a/src/Mealz/MealBundle/Resources/config/routing.yml
+++ b/src/Mealz/MealBundle/Resources/config/routing.yml
@@ -316,6 +316,11 @@ MealzMealBundle_api_non_participating:
defaults: { _controller: App\Mealz\MealBundle\Controller\ParticipantController::getProfilesWithoutParticipation }
methods: [ GET ]
+MealzMealBundle_api_participation_combi:
+ path: /api/participations/combi/{meal}
+ defaults: { _controller: App\Mealz\MealBundle\Controller\ParticipantController::getCombiForMeal }
+ methods: [ GET ]
+
MealzMealBundle_Show_participations:
path: /show/participations
defaults: { _controller: App\Mealz\MealBundle\Controller\FrontendController::renderIndex }
diff --git a/src/Resources/src/api/getDishesForCombi.ts b/src/Resources/src/api/getDishesForCombi.ts
new file mode 100644
index 000000000..5ff87176e
--- /dev/null
+++ b/src/Resources/src/api/getDishesForCombi.ts
@@ -0,0 +1,17 @@
+import { Dish } from "@/stores/dishesStore";
+import useApi from "./api";
+
+/**
+ * Fetches the dishes a combi meal consists of
+ * @param mealId The id of the combi-meal
+ */
+export default async function getDishesForCombi(mealId: number) {
+ const { error, response, request } = useApi
+ {{ combiDescription.join(' - ') }} +