Esempio n. 1
0
        public async Task <ActionResult <SafeLocationModel> > UpdateSafeLocationAsync([FromRoute] Guid locationId, [FromBody] SafeLocationRequest safeLocation)
        {
            var sub    = User.Claims.FirstOrDefault(c => c.Type == "sub")?.Value;
            var query  = new UpdateSafeLocation(sub, locationId, safeLocation);
            var result = await _mediator.Send(query);

            if (result.IsFailure)
            {
                return(BadRequest());
            }

            return(Ok(result.Value));
        }
Esempio n. 2
0
 public AddSafeLocation(string userSub, Guid groupId, SafeLocationRequest safeLocation)
 {
     UserSub      = userSub;
     GroupId      = groupId;
     SafeLocation = safeLocation;
 }
 public async Task <ActionResult <SafeLocationModel> > UpdateSafeLocationAsync([FromRoute] Guid groupId, [FromRoute] Guid locationId, [FromBody] SafeLocationRequest safeLocation)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 public UpdateSafeLocation(string userSub, Guid safeLocationId, SafeLocationRequest safeLocation)
 {
     UserSub        = userSub;
     SafeLocationId = safeLocationId;
     SafeLocation   = safeLocation;
 }