Example #1
0
        public StatusModel EditTopic(string scenarioId, string topicId, [FromBody] ApiFormInput formData)
        {
            if (formData == null)
            {
                return(CustomBadRequestResult <StatusModel>(Constants.InputDataIsMissing));
            }

            if (!_authenticationManager.CheckAccessToken(formData.ticket))
            {
                return(CustomBadRequestResult <StatusModel>(Constants.NotAuthorized));
            }

            try
            {
                var scenarioFolder = _scenarioService.GetScenarioFolder(scenarioId);

                _topicService.EditTopic(scenarioFolder, formData.unique_id, topicId);
            }
            catch (Exception ex)
            {
                return(CustomBadRequestResult <StatusModel>(ex.Message));
            }

            return(new StatusModel());
        }