コード例 #1
0
        public async Task <IActionResult> CreateAd(Guid memberId, [FromBody] AdForCreationDto adForCreation)
        {
            if (!User.CheckAuthorization(memberId))
            {
                return(BadRequest(new UnauthorizedErrorResult()));
            }

            IResult result = await _adService.CreateAsync(adForCreation);

            if (result.Success)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }