public async Task SetPlace(string userId, string itemId, SetPlaceRequest setPlaceRequest)
        {
            if (null != setPlaceRequest.RememberForLocation)
            {
                await _travelServiceClient.Users[userId].Locations[setPlaceRequest.RememberForLocation].Put(new TravelService.Models.Coordinate()
                {
                    Lat = setPlaceRequest.Place.Lat,
                    Lng = setPlaceRequest.Place.Lng
                });
            }
            else if (null != setPlaceRequest.RememberForSubject)
            {
                await _travelServiceClient.Users[userId].Locations[$"#event:{setPlaceRequest.RememberForLocation}"].Put(new TravelService.Models.Coordinate()
                {
                    Lat = setPlaceRequest.Place.Lat,
                    Lng = setPlaceRequest.Place.Lng
                });
            }
            await _focusStore.SetPlaceForItem(userId, itemId, setPlaceRequest.Place);

            if ((await _focusStore.GetActiveAsync(userId)).Any(v => v.Id == itemId))
            {
                await _focusService.PatchAsync(userId);
            }
        }
Beispiel #2
0
        public async Task <IActionResult> SetPlace(SetPlaceRequest putPlace)
        {
            var active = await focusStore.GetActiveAsync(User.GetId());

            return(Ok(active));
        }