Example #1
0
        public async Task <IActionResult> AddModifiersCriteria(long idSelectorConfig, [FromBody] Criteria criteria)
        {
            try
            {
                HttpResponseMessageResult res = await Adapter.AddModifiersCriteria(idSelectorConfig, criteria);

                if (res.IsSuccess)
                {
                    Logger.LogInformation($"Add modifiers criteria to SelectorConfig {idSelectorConfig} with success.");
                    return(Ok());
                }
                else
                {
                    Logger.LogWarning(LoggingEvents.WARNING_ERROR, res.Message);
                    return(StatusCode(500, res.Message));
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message);
                return(StatusCode(500, ex.Message));
            }
        }