Skip to content

Commit bdb7536

Browse files
committed
little style fix
1 parent d85c77f commit bdb7536

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

HwProj.CoursesService/HwProj.CoursesService.API/Controllers/CourseGroupsController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Linq;
1+
using System.Linq;
32
using System.Threading.Tasks;
43
using AutoMapper;
54
using HwProj.CoursesService.API.Filters;

HwProj.CoursesService/HwProj.CoursesService.API/Services/GroupsService.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Linq;
1+
using System.Linq;
32
using System.Threading.Tasks;
43
using AutoMapper;
54
using HwProj.CoursesService.API.Models;
@@ -67,8 +66,7 @@ public async Task DeleteGroupAsync(long groupId)
6766

6867
public async Task UpdateAsync(long groupId, Group updated)
6968
{
70-
var group = (await _groupsRepository.GetGroupsWithGroupMatesAsync(new[] { groupId }))
71-
.FirstOrDefault() ?? throw new InvalidOperationException($"Group with id {groupId} not found");
69+
var group = (await _groupsRepository.GetGroupsWithGroupMatesAsync(new[] { groupId })).FirstOrDefault();
7270

7371
foreach (var groupMate in group.GroupMates.ToList())
7472
{

HwProj.CoursesService/HwProj.CoursesService.API/Services/HomeworksService.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ public async Task<Homework> UpdateHomeworkAsync(long homeworkId, CreateHomeworkV
138138
}
139139

140140
if (options.SendNotification && update.PublicationDate <= DateTime.UtcNow)
141-
{
142141
_eventBus.Publish(new UpdateHomeworkEvent(update.Title, course.Id, course.Name, notificationStudentIds));
143-
}
144142

145143
await _homeworksRepository.UpdateAsync(homeworkId, hw => new Homework()
146144
{
@@ -151,7 +149,7 @@ public async Task<Homework> UpdateHomeworkAsync(long homeworkId, CreateHomeworkV
151149
PublicationDate = update.PublicationDate,
152150
IsDeadlineStrict = update.IsDeadlineStrict,
153151
Tags = update.Tags,
154-
GroupId = update.GroupId
152+
GroupId = update.GroupId,
155153
});
156154

157155
var updatedHomework = await _homeworksRepository.GetWithTasksAsync(homeworkId);
@@ -167,10 +165,9 @@ private async Task UpdateGroupFilters(long courseId, long homeworkId, List<Group
167165
if (globalFilter != null)
168166
{
169167
var filter = globalFilter.Filter;
168+
170169
if (!filter.HomeworkIds.Contains(homeworkId))
171-
{
172170
filter.HomeworkIds.Add(homeworkId);
173-
}
174171

175172
await _courseFilterRepository.UpdateAsync(globalFilter.Id, f =>
176173
new CourseFilter
@@ -199,9 +196,7 @@ await _courseFilterRepository.UpdateAsync(globalFilter.Id, f =>
199196
{
200197
var filter = studentFilter.Filter;
201198
if (!filter.HomeworkIds.Contains(homeworkId))
202-
{
203199
filter.HomeworkIds.Add(homeworkId);
204-
}
205200

206201
await _courseFilterRepository.UpdateAsync(studentFilter.Id, f =>
207202
new CourseFilter

0 commit comments

Comments
 (0)