Exemple #1
0
        public async Task <IActionResult> Create(SourceUrlDto model)
        {
            try
            {
                var result = await _urlService.CreateShortCode(model);

                if (!result.IsSuccess)
                {
                    return(BadRequest(result));
                }

                return(Ok(result.Response));
            }
            catch (Exception ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }