Création/mise à jour basique d'un DAD
This commit is contained in:
40
client/src/gql/mutations/dsf.tsx
Normal file
40
client/src/gql/mutations/dsf.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import { gql, useQuery, useMutation } from '@apollo/client';
|
||||
import { QUERY_DECISION_SUPPORT_FILES } from '../queries/dsf';
|
||||
|
||||
export const MUTATION_CREATE_DECISION_SUPPORT_FILE = gql`
|
||||
mutation createDecisionSupportFile($changes: DecisionSupportFileChanges!) {
|
||||
createDecisionSupportFile(changes: $changes) {
|
||||
id,
|
||||
title,
|
||||
status,
|
||||
sections,
|
||||
createdAt,
|
||||
updatedAt
|
||||
}
|
||||
}`;
|
||||
|
||||
export function useCreateDecisionSupportFileMutation() {
|
||||
return useMutation(MUTATION_CREATE_DECISION_SUPPORT_FILE, {
|
||||
refetchQueries: [{query: QUERY_DECISION_SUPPORT_FILES}],
|
||||
});
|
||||
}
|
||||
|
||||
export const MUTATION_UPDATE_DECISION_SUPPORT_FILE = gql`
|
||||
mutation updateDecisionSupportFile($id: ID!, $changes: DecisionSupportFileChanges!) {
|
||||
updateDecisionSupportFile(id: $id, changes: $changes) {
|
||||
id,
|
||||
title,
|
||||
status,
|
||||
sections,
|
||||
createdAt,
|
||||
updatedAt
|
||||
}
|
||||
}`;
|
||||
|
||||
export function useUpdateDecisionSupportFileMutation() {
|
||||
return useMutation(MUTATION_UPDATE_DECISION_SUPPORT_FILE, {
|
||||
refetchQueries: [{
|
||||
query: QUERY_DECISION_SUPPORT_FILES,
|
||||
}],
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user