Ejemplo n.º 1
0
        public async Task <Place> CreateEstablishment([FromBody] Place establishment)
        {
            var userId = HttpContext.User.Identity.Name;

            var docRef = await _placesService.CreatePlace(establishment, userId);

            return(docRef);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <Place> > CreateEstablishment([FromBody] Place establishment)
        {
            var userId = GetUserId();

            var docRef = await _placesService.CreatePlace(establishment, userId);

            return(docRef);
        }
Ejemplo n.º 3
0
        public IActionResult Post([FromBody] Place place)
        {
            var request = new PostRequest <Place> {
                Payload = place
            };
            var response = _placeServices.CreatePlace(request);

            if (!response.Result)
            {
                return(BadRequest(response.Errors));
            }

            return(CreatedAtAction("Post", response.Place.Id));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> CreatePlace(PlacesRegisterRequestModel model)
        {
            var place = await _placesService.CreatePlace(model);

            return(Ok(place));
        }