public async Task <ActionResult> SetNotifications(Guid studentId, [FromBody] NotificationsModel notificationsModel) { var student = await _repository.GetStudentWithNotification(studentId); if (student == null) { return(NotFound()); } var notificationentity = _mapper.Map <NotificationsSettings>(notificationsModel); notificationentity.StudentId = studentId; await _repository.UpdateNotification(notificationentity); await _repository.SaveAsync(); var telegramDataExists = _repository.UserTelegramDataExists(studentId); if (notificationsModel.NotificationType == "Telegram" && !telegramDataExists) { return(Ok(new { message = "Для роботи нотифікацій через телеграм бот, потрібно авторизуватись через телеграм, зайти в телеграмм бот і натиснути /start" })); } return(NoContent()); }