Exemple #1
0
        public IActionResult CreateNewValues([FromBody] CommonResourcesCreateModel model)
        {
            var res = _commonResourcesServices.Create(model);

            if (!res.Succeeded)
            {
                return(NotFound());
            }
            return(Ok(res));
        }
        public IActionResult Update(CommonResourceUpdateModel model)
        {
            var entry    = _commonResourcesServices.GetResourceValue(model.LanguageFid, model.ResourceKey);
            var response = BaseResponse <bool> .BadRequest();

            if (entry.IsSuccessStatusCode)
            {
                response = _commonResourcesServices.Update(model);
            }
            else
            {
                response = _commonResourcesServices.Create(model);
            }
            return(Ok(response));
        }