fix: края архива, истории, пагинации и лимита попыток
This commit is contained in:
@@ -290,7 +290,7 @@ class GroupService(
|
||||
MembershipHistoryRow(
|
||||
id = event.id.toString(),
|
||||
studentId = event.studentId.toString(),
|
||||
studentName = studentsById[event.studentId]?.fullName.orEmpty(),
|
||||
studentName = studentsById[event.studentId]?.fullName?.takeIf { it.isNotBlank() } ?: event.studentId.toString(),
|
||||
fromGroupId = event.fromGroupId?.toString(),
|
||||
fromGroupName = event.fromGroupId?.let { groupsById[it]?.name },
|
||||
toGroupId = event.toGroupId?.toString(),
|
||||
@@ -306,8 +306,8 @@ class GroupService(
|
||||
@Transactional
|
||||
fun restoreGroup(groupId: UUID): GroupDetail {
|
||||
val group = groups.findById(groupId).orElseThrow { NotFoundException("Группа не найдена") }
|
||||
if (group.status == GroupStatus.ACTIVE) {
|
||||
throw BadRequestException("Группа ${group.name} уже активна")
|
||||
if (group.status != GroupStatus.ARCHIVED) {
|
||||
throw BadRequestException("Группа ${group.name} не находится в архиве")
|
||||
}
|
||||
group.status = GroupStatus.ACTIVE
|
||||
groups.save(group)
|
||||
|
||||
Reference in New Issue
Block a user