Exemple #1
0
        public async Task <IActionResult> AcceptTranslate(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 updateResult = await translationRepository.AcceptTranslation(idTranslation);

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

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

            return(Ok());
        }