mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2024-11-16 22:29:24 +08:00
Refresh logs if new product is added or removed
This commit is contained in:
parent
52f115c610
commit
971a798af0
2 changed files with 4 additions and 15 deletions
|
@ -70,19 +70,13 @@ export default function Logs() {
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||||
Log ID
|
Product Changed
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||||
Product ID
|
Quantity Changed To
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||||
Product
|
Transaction by
|
||||||
</TableCell>
|
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
|
||||||
Quantity
|
|
||||||
</TableCell>
|
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
|
||||||
User
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||||
Timestamp
|
Timestamp
|
||||||
|
@ -95,12 +89,6 @@ export default function Logs() {
|
||||||
key={row.id}
|
key={row.id}
|
||||||
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
|
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
|
||||||
>
|
>
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_S }}>
|
|
||||||
{row.history_id}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_S }}>
|
|
||||||
{row.id}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell style={{ ...styles.text_white, ...styles.text_S }}>
|
<TableCell style={{ ...styles.text_white, ...styles.text_S }}>
|
||||||
{row.name}
|
{row.name}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
@ -17,6 +17,7 @@ export default function NewProduct() {
|
||||||
mutationFn: AddProduct,
|
mutationFn: AddProduct,
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries("products");
|
queryClient.invalidateQueries("products");
|
||||||
|
queryClient.invalidateQueries("logs");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue