Skip to content

Commit

Permalink
include description with snapshot creation (#981)
Browse files Browse the repository at this point in the history
Co-authored-by: Chet Joswig <[email protected]>
  • Loading branch information
joswig and Chet Joswig authored Nov 2, 2023
1 parent edde9ae commit 44ddef2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/utilities/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,16 +933,12 @@ const effects = {
): Promise<void> {
const data = await reqHasura<{ snapshot_id: number }>(
gql.CREATE_PLAN_SNAPSHOT,
{ plan_id: planId, /* snapshot_description: description, */ snapshot_name: name },
{ description, plan_id: planId, snapshot_name: name },
user,
);
const { createSnapshot } = data;
if (createSnapshot != null) {
const { snapshot_id } = createSnapshot;
// TODO this will soon be part of create plan snapshot
const updates = { description };
await reqHasura(gql.UPDATE_PLAN_SNAPSHOT, { planSnapshot: updates, snapshot_id }, user);

// Associate tags with the snapshot
const newPlanSnapshotTags: PlanSnapshotTagsInsertInput[] =
tags?.map(({ id: tag_id }) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ const gql = {
`,

CREATE_PLAN_SNAPSHOT: `#graphql
mutation CreatePlanSnapshot($plan_id: Int!, $snapshot_name: String!) {
createSnapshot: create_snapshot(args: { _plan_id: $plan_id, _snapshot_name: $snapshot_name } ) {
mutation CreatePlanSnapshot($plan_id: Int!, $snapshot_name: String!, $description: String!) {
createSnapshot: create_snapshot(args: { _plan_id: $plan_id, _snapshot_name: $snapshot_name, _description: $description } ) {
snapshot_id
}
}
Expand Down

0 comments on commit 44ddef2

Please sign in to comment.