Kurt Hutten
2021-06-06 06:12:26 +10:00
parent 7caf857c98
commit a0b588000a
17 changed files with 50 additions and 84 deletions

View File

@@ -1,4 +1,5 @@
import { useMutation, useFlash } from '@redwoodjs/web'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { Link, routes } from '@redwoodjs/router'
import { QUERY } from 'src/components/AdminPartsCell'
@@ -21,10 +22,6 @@ const truncate = (text) => {
return output
}
const jsonTruncate = (obj) => {
return truncate(JSON.stringify(obj, null, 2))
}
const timeTag = (datetime) => {
return (
<time dateTime={datetime} title={datetime}>
@@ -38,10 +35,9 @@ const checkboxInputTag = (checked) => {
}
const AdminParts = ({ parts }) => {
const { addMessage } = useFlash()
const [deletePart] = useMutation(DELETE_PART_MUTATION, {
onCompleted: () => {
addMessage('Part deleted.', { classes: 'rw-flash-success' })
toast.success('Part deleted.')
},
// This refetches the query on the list page. Read more about other ways to
// update the cache over here: