Skip to content

Commit

Permalink
Merge pull request #1439 from krayin/note
Browse files Browse the repository at this point in the history
fix: #1433 note issue
  • Loading branch information
jitendra-webkul authored Aug 23, 2024
2 parents 463ab29 + ec72fe3 commit 7c4efa6
Showing 1 changed file with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,28 @@ public function store(): RedirectResponse|JsonResponse
'file' => 'required_if:type,file',
]);

/**
* Check if meeting is overlapping with other meetings
*/
$isOverlapping = $this->activityRepository->isDurationOverlapping(
request()->input('schedule_from'),
request()->input('schedule_to'),
request()->input('participants'),
request()->input('id')
);

if ($isOverlapping) {
if (request()->ajax()) {
return response()->json([
'message' => trans('admin::app.activities.overlapping-error'),
], 400);
if (request('type') === 'meeting') {
/**
* Check if meeting is overlapping with other meetings.
*/
$isOverlapping = $this->activityRepository->isDurationOverlapping(
request()->input('schedule_from'),
request()->input('schedule_to'),
request()->input('participants'),
request()->input('id')
);

if ($isOverlapping) {
if (request()->ajax()) {
return response()->json([
'message' => trans('admin::app.activities.overlapping-error'),
], 400);
}

session()->flash('success', trans('admin::app.activities.overlapping-error'));

return redirect()->back();
}

session()->flash('success', trans('admin::app.activities.overlapping-error'));

return redirect()->back();
}

Event::dispatch('activity.create.before');
Expand Down

0 comments on commit 7c4efa6

Please sign in to comment.