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>
|
||||
<TableRow>
|
||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||
Log ID
|
||||
Product Changed
|
||||
</TableCell>
|
||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||
Product ID
|
||||
Quantity Changed To
|
||||
</TableCell>
|
||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||
Product
|
||||
</TableCell>
|
||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||
Quantity
|
||||
</TableCell>
|
||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||
User
|
||||
Transaction by
|
||||
</TableCell>
|
||||
<TableCell style={{ ...styles.text_white, ...styles.text_M }}>
|
||||
Timestamp
|
||||
|
@ -95,12 +89,6 @@ export default function Logs() {
|
|||
key={row.id}
|
||||
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 }}>
|
||||
{row.name}
|
||||
</TableCell>
|
||||
|
|
|
@ -17,6 +17,7 @@ export default function NewProduct() {
|
|||
mutationFn: AddProduct,
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries("products");
|
||||
queryClient.invalidateQueries("logs");
|
||||
},
|
||||
});
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue