Added document delete + refined document upload

This commit is contained in:
Patrick Fic
2020-01-24 12:52:13 -08:00
parent 5f256c204d
commit 066b900409
8 changed files with 152 additions and 18 deletions

View File

@@ -7,6 +7,7 @@ export const GET_DOCUMENTS_BY_JOB = gql`
url
thumb_url
name
key
}
}
`;
@@ -14,6 +15,20 @@ export const GET_DOCUMENTS_BY_JOB = gql`
export const INSERT_NEW_DOCUMENT = gql`
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
insert_documents(objects: $docInput) {
returning {
id
url
thumb_url
name
key
}
}
}
`;
export const DELETE_DOCUMENT = gql`
mutation DELETE_DOCUMENT($id: uuid) {
delete_documents(where: { id: { _eq: $id } }) {
returning {
id
}