@@ -31,9 +31,11 @@ discard block |
||
31 | 31 | $group = Group::findOrFail($groupId); |
32 | 32 | $this->authorize($group); |
33 | 33 | $meetings = $group->meetings(); |
34 | - if ($request->query('current')) |
|
35 | - $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
36 | - $query->where('start_time', '=', NULL);//to be planned |
|
34 | + if ($request->query('current')) { |
|
35 | + $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
36 | + $query->where('start_time', '=', NULL); |
|
37 | + } |
|
38 | + //to be planned |
|
37 | 39 | //datetime to consider timezone, don't use mysql NOW() |
38 | 40 | $query->orWhere('start_time', '>=', new \DateTime());//planned |
39 | 41 | }); |
@@ -90,8 +92,9 @@ discard block |
||
90 | 92 | $meeting = Meeting::findOrFail($meetingId); |
91 | 93 | $this->authorize($meeting); |
92 | 94 | $input = $request->all(); |
93 | - if ($meeting->start_time != NULL && $meeting->duration == $input['duration']) |
|
94 | - return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
95 | + if ($meeting->start_time != NULL && $meeting->duration == $input['duration']) { |
|
96 | + return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
97 | + } |
|
95 | 98 | $meeting->update($input); |
96 | 99 | return $meeting; |
97 | 100 | } |