got something working thats only a little hacky
This commit is contained in:
31
app/web/src/helpers/hooks/useUpdateProjectImages.ts
Normal file
31
app/web/src/helpers/hooks/useUpdateProjectImages.ts
Normal 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 }
|
||||
}
|
||||
Reference in New Issue
Block a user