File tree Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Original file line number Diff line number Diff line change @@ -131,32 +131,13 @@ const Home = () => {
131131
132132 useEffect ( ( ) => {
133133 const fetchStoryCount = async ( ) => {
134- const response = await axios . post (
135- `${ apiURL } /graphql` ,
136- {
137- query : `
138- query {
139- userStoriesConnection(where: { user_story_status: { Status: "${ currentStateSelected } " } }) {
140- aggregate {
141- count
142- }
143- }
144- }`
145- } ,
146- {
147- withCredentials : true
148- }
149- )
150- setStoryCount ( response . data . data . userStoriesConnection . aggregate . count )
151- }
152- const fetchStoryCountWithProduct = async ( ) => {
153134 const response = await axios . post (
154135 `${ apiURL } /graphql` ,
155136 {
156137 query : `
157138 query {
158139 userStoriesConnection(where: { user_story_status: { Status: "${ currentStateSelected } " },
159- product: { Name: " ${ product } " } }) {
140+ ${ productQuery } }) {
160141 aggregate {
161142 count
162143 }
@@ -169,12 +150,8 @@ const Home = () => {
169150 )
170151 setStoryCount ( response . data . data . userStoriesConnection . aggregate . count )
171152 }
172- if ( product === 'All' ) {
173- fetchStoryCount ( )
174- } else {
175- fetchStoryCountWithProduct ( )
176- }
177- } , [ currentStateSelected , product ] )
153+ fetchStoryCount ( )
154+ } , [ currentStateSelected , product , productQuery ] )
178155
179156 useEffect ( ( ) => {
180157 const fetchProducts = async ( ) => {
You can’t perform that action at this time.
0 commit comments