Skip to content

Commit

Permalink
Merge pull request #10 from danielres/24-fix-tagtree-not-updated-on-l…
Browse files Browse the repository at this point in the history
…evel-change

24 fix Tagtree not updated on Level change
  • Loading branch information
danielres committed Oct 1, 2019
2 parents 0a67c37 + 1201bc5 commit a54269d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/src/components/taggings/Level.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation } from "@apollo/react-hooks";
import { useMutation, useQuery } from "@apollo/react-hooks";
import classnames from "classnames";
import React, { useRef, useState } from "react";
import { UPDATE_TAGGING } from "../../gql/tags";
import { GET_TAG_TREE_DATA, UPDATE_TAGGING } from "../../gql/tags";
import useOnOutsideClick from "../../utils/useOnOutsideClick";

const LEVELS = [0, 20, 40, 60, 80, 100];
Expand All @@ -27,12 +27,13 @@ const Level = ({ colorClass, tagging }) => {
useOnOutsideClick(ref, close);

const [updateTagging, response] = useMutation(UPDATE_TAGGING);
const { refetch } = useQuery(GET_TAG_TREE_DATA);

const setLevel = level => {
close();
updateTagging({
variables: { id: tagging.id, level }
});
}).then(refetch);
};

if (isOpen)
Expand Down

0 comments on commit a54269d

Please sign in to comment.