Beispiel #1
0
        public async Task OnPostAssignTutor(Guid id)
        {
            var result = await _privateLessonService.AssignTutor(new AssignTutor
            {
                PricePerHour    = PricePerHour,
                PrivateLessonId = id
            });

            if (result.IsSuccess)
            {
                Messages.Add("Announcement was assinged to your account 😊");
            }
            else
            {
                Messages.AddRange(result.Errors);
            }

            privateLesson = await _privateLessonService.Get(id);
        }
Beispiel #2
0
        public async Task <IActionResult> AssignTutor([FromBody] AssignTutor command)
        {
            var result = await _privateLessonService.AssignTutor(command.PrivateLessonId, UserId, command.PricePerHour);

            return(result.IsSuccess ? NoContent() : (IActionResult)Ok(result));
        }