CEC-1965 Cleanup (#163)

This commit is contained in:
John Wu
2022-07-01 13:00:26 -07:00
committed by GitHub
parent fe40c26c56
commit 86418d093c
5 changed files with 49 additions and 81 deletions

View File

@@ -39,13 +39,12 @@ const Main = () => {
},
} = useUserContext();
const approve = async (event) => {
const update = async (event) => {
event.preventDefault();
try {
await updateSupplier(email, token);
setMessage(`Updated ${email}`);
} catch (e) {
console.log(e);
setMessage(e.message);
}
};
@@ -180,7 +179,7 @@ const Main = () => {
variant="contained"
color="primary"
className={classes.submit}
onClick={approve}
onClick={update}
>
{busy ? "Submitting..." : "Submit"}
</Button>

View File

@@ -23,6 +23,29 @@ exports[`Suppliers page Render 1`] = `
<tr
class="MuiTableRow-root MuiTableRow-head"
>
<th
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
scope="col"
>
<span
aria-disabled="false"
class="MuiButtonBase-root MuiTableSortLabel-root"
role="button"
tabindex="0"
>
ID
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
/>
</svg>
</span>
</th>
<th
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
scope="col"
@@ -175,6 +198,9 @@ exports[`Suppliers page Render 1`] = `
<tr
class="MuiTableRow-root"
>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
/>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
>
@@ -217,6 +243,9 @@ exports[`Suppliers page Render 1`] = `
<tr
class="MuiTableRow-root"
>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
/>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
>
@@ -259,6 +288,9 @@ exports[`Suppliers page Render 1`] = `
<tr
class="MuiTableRow-root"
>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
/>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
>

View File

@@ -18,6 +18,10 @@ import TableHeaderSortable from "../../Table/HeaderSortable";
import { logger } from "../../../services/monitoring";
const tableColumns = [
{
id: "id",
label: "ID",
},
{
id: "contact",
label: "Contact",
@@ -115,6 +119,7 @@ const SupplierTable = (props) => {
{suppliers.map((row, index) => {
return (
<TableRow key={index}>
<TableCell align="center">{row?.id}</TableCell>
<TableCell align="center">
<Link to={`/supplier/${row.email}`}>{row.contact}</Link>
</TableCell>