Example #1
0
        public async Task <IActionResult> DeleteTranslate(Guid idTranslation)
        {
            //Check if file by id exists in database
            var foundedTranslation = await translationRepository.GetByIDAsync(idTranslation);

            if (foundedTranslation == null)
            {
                return(NotFound($"Translation by id \"{idTranslation}\" not found"));
            }

            var deleteResult = await translationRepository.RemoveAsync(idTranslation);


            if (!deleteResult)
            {
                return(BadRequest($"Failed to remove translation with id \"{ idTranslation }\" from database"));
            }


            //_userActionRepository.AddDeleteTranslationActionAsync((int)ur.GetID(User.Identity.Name), User.Identity.Name, null, idTranslation);

            return(Ok());
        }