public async Task <IActionResult> Activate(long id) { try { await _supplierService.Activate(id); } catch (Exception ex) { _toastNotification.AddErrorToastMessage(ex.Message); } return(RedirectToAction("Index")); }
public async Task <ActionResult> Activate(long id) { try { await _supplierService.Activate(id); var Supplier = await _supplierRepo.GetById(id) ?? throw new Exception("Supplier Not Found."); return(Ok(CreateReponseDto(Supplier))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }