Skip to content

Commit

Permalink
fix(frontend): edit is_available (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB committed Nov 25, 2020
1 parent 9c3aa88 commit 254156f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion targets/frontend/src/pages/contenus/[id].js
Expand Up @@ -37,12 +37,13 @@ query getDocumentById($id: String!) {
`;

const updateDocumentMutation = `
mutation updateDocument($cdtnId: String!, $metaDescription: String!, $title: String!, $document: jsonb!){
mutation updateDocument($cdtnId: String!, $metaDescription: String!, $title: String!, $isAvailable: Boolean!, $document: jsonb!){
document: update_documents_by_pk(
_set:{
document: $document
meta_description: $metaDescription
title: $title
is_available: $isAvailable
},
pk_columns: {
cdtn_id: $cdtnId
Expand Down Expand Up @@ -78,6 +79,7 @@ export function DocumentPage() {
return executeUpdate({
cdtnId: data.document.cdtn_id,
document: jsonDoc.current.document,
isAvailable: data.document.is_available,
metaDescription: jsonDoc.current.meta_description,
title: jsonDoc.current.title,
}).then(({ data }) => {
Expand All @@ -98,6 +100,7 @@ export function DocumentPage() {
if (result.error) {
console.error(result.error);
}
setHasChanged(false);
setSubmitIdle(false);
});
}
Expand Down

0 comments on commit 254156f

Please sign in to comment.