Skip to content

Commit

Permalink
requested changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Ruf committed Feb 7, 2024
1 parent 11afdaf commit e4d2c50
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/Mealz/MealBundle/Controller/MealGuestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
class MealGuestController extends BaseController
{
private EventParticipationService $eventPartSrv;
private GuestParticipationService $gps;
private GuestParticipationService $guestPartSrv;
private EventDispatcherInterface $eventDispatcher;

public function __construct(
EventParticipationService $eventPartSrv,
GuestParticipationService $gps,
GuestParticipationService $guestPartSrv,
EventDispatcherInterface $eventDispatcher
) {
$this->eventPartSrv = $eventPartSrv;
$this->gps = $gps;
$this->guestPartSrv = $guestPartSrv;
$this->eventDispatcher = $eventDispatcher;
}

Expand All @@ -45,9 +45,9 @@ public function joinAsGuest(Request $request): JsonResponse
'meals' => $meals,
'slot' => $slot,
'dishSlugs' => $dishSlugs
] = $this->gps->getGuestInvitationData($request);
] = $this->guestPartSrv->getGuestInvitationData($request);

$participants = $this->gps->join($profile, $meals, $slot, $dishSlugs);
$participants = $this->guestPartSrv->join($profile, $meals, $slot, $dishSlugs);
$this->triggerJoinEvents($participants);
} catch (Exception $e) {
$this->logException($e, 'guest registration error');
Expand Down
2 changes: 1 addition & 1 deletion src/Mealz/MealBundle/Service/ParticipationServiceTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function slotIsAvailable(Slot $slot, DateTime $date): bool
*/
private function createParticipation(Profile $profile, Meal $meal, ?Slot $slot = null, array $dishSlugs = []): Participant
{
$participant = new Participant($profile, $meal, null);
$participant = new Participant($profile, $meal);
if (null !== $slot) {
$participant->setSlot($slot);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import CostsSettlement from './views/CostsSettlement.vue';
import CashRegister from './views/CashRegister.vue';
import Login from '@/views/Login.vue';
import Events from './views/Events.vue';
import GuestEvent from './views/GuestEvent.vue';
import GuestEvent from './views/GuestEvent.vue';

import { createRouter, createWebHistory } from 'vue-router';
import { userDataStore } from '@/stores/userDataStore';
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/stores/eventsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const EVENT_PARTICIPATION_UPDATE = 'eventParticipationUpdate';

const EventsState = reactive<EventsState>({
events: [],
error: "",
error: '',
isLoading: false
});

Expand Down
1 change: 0 additions & 1 deletion src/Resources/style/output.css.map

This file was deleted.

8 changes: 4 additions & 4 deletions src/Resources/tests/unit/api/putEventUpdate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useApi from '@/api/api';
import putEventUpdate from '@/api/putEventUpdate';
import { Event } from '@/stores/eventsStore';
import { ref } from 'vue';
import useApi from "@/api/api";
import putEventUpdate from "@/api/putEventUpdate";
import { Event } from "@/stores/eventsStore";
import { ref } from "vue";

const testEvent: Event = {
id: 0,
Expand Down
10 changes: 5 additions & 5 deletions src/Resources/tests/unit/stores/eventsStore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import useApi from '@/api/api';
import { ref } from 'vue';
import Events from '../fixtures/getEvents.json';
import { useEvents, Event } from '@/stores/eventsStore';
import { flushPromises } from '@vue/test-utils';
import useApi from "@/api/api";
import { ref } from "vue";
import Events from "../fixtures/getEvents.json";
import { useEvents, Event } from "@/stores/eventsStore";
import { flushPromises } from "@vue/test-utils";

const testEvent: Event = {
id: 7,
Expand Down

0 comments on commit e4d2c50

Please sign in to comment.