got something working thats only a little hacky

This commit is contained in:
Kurt Hutten
2021-08-16 18:43:52 +10:00
parent 180cbb9503
commit 9fa22a0469
12 changed files with 257 additions and 202 deletions

View File

@@ -0,0 +1,31 @@
import { useMutation } from '@redwoodjs/web'
const UPDATE_PROJECT_IMAGES_MUTATION_HOOK = gql`
mutation updateProjectImages(
$id: String!
$mainImage64: String
$socialCard64: String
) {
updateProjectImages(
id: $id
mainImage64: $mainImage64
socialCard64: $socialCard64
) {
id
mainImage
socialCard {
id
url
}
}
}
`
export const useUpdateProjectImages = ({ onCompleted = () => {} }) => {
const [updateProjectImages, { loading, error }] = useMutation(
UPDATE_PROJECT_IMAGES_MUTATION_HOOK,
{ onCompleted }
)
return { updateProjectImages, loading, error }
}