diff --git a/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs b/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs index e6fbb60..1ef9734 100644 --- a/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs +++ b/MBS_COMMAND.Application/UserCases/Commands/Schedules/CreateScheduleCommandHandler.cs @@ -33,7 +33,7 @@ public async Task Handle(Command.CreateScheduleCommand request, Cancella return Result.Failure(new Error("400", "User is not exist !")); } - var group = await _groupRepository.FindSingleAsync(x => x.LeaderId.Equals(user.Id), cancellationToken); + var group = await _groupRepository.FindSingleAsync(x => x.LeaderId.Equals(user.Id) && x.ProjectId.Equals(request.ProjectId), cancellationToken); if (group == null || group.IsDeleted) { @@ -86,4 +86,4 @@ public async Task Handle(Command.CreateScheduleCommand request, Cancella return Result.Success("Booking Schedule Successfully !"); } -} \ No newline at end of file +}