Esempio n. 1
0
        public async Task <IActionResult> DeactivateInquiryAsync([FromBody] int id)
        {
            try
            {
                _logger.LogDebug("Deavtivating Inventory part");
                bool success = await _inquiryService.DeactivateAsync(id);

                if (success)
                {
                    _logger.LogDebug("Inquiry updated");
                    return(Ok("Inventory part updated successfully"));
                }
                else
                {
                    _logger.LogDebug("Inquiry update failed. Inquiry part not found");
                    return(Conflict("Inquiry part not found"));
                }
            }
            catch (Exception ex)
            {
                //log
                _logger.LogError("An Exception occured: {ex}", ex.Message);
                _logger.LogError("Stack Trace: {ex}", ex.StackTrace);
                return(BadRequest());
            }
        }