Esempio n. 1
0
        public async Task <IActionResult> RejectTranslate(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.RejectTranslation(idTranslation);

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

            //int? pk = null;
            //_userActionRepository.AddUpdateTranslationActionAsync((int)ur.GetID(User.Identity.Name), User.Identity.Name, pk, idTranslation, foundedTranslation.ID_String, foundedTranslation.ID_Locale, "Убрали галочку");
            return(Ok());
        }