Ejemplo n.º 1
0
        public HttpStatusCode CreateCatalog(CreateCatalogDto catalog)
        {
            string userId = User.FindFirst(ClaimTypes.NameIdentifier).Value;

            if (string.IsNullOrEmpty(userId))
            {
                return(HttpStatusCode.Unauthorized);
            }

            var response = _catalogRepository.CreateCatalog(catalog, userId);

            switch (response)
            {
            case HttpStatusCode.OK:
                return(HttpStatusCode.OK);

            case HttpStatusCode.InternalServerError:
                return(HttpStatusCode.InternalServerError);

            default:
                return(HttpStatusCode.NotFound);
            }
        }