Skip to content

Commit

Permalink
fix: corrige l'écrasement de variables query
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Feb 26, 2025
1 parent b57fb29 commit 3a448e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions front/src/components/corpus/CorpusSelectItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ export default function CorpusSelectItem({
async (event) => {
event.preventDefault()
const [corpusId, checked] = [event.target.value, event.target.checked]
const query = checked ? addArticleToCorpus : removeArticleFromCorpus
const graphqlQuery = checked
? addArticleToCorpus
: removeArticleFromCorpus
await query({
query,
query: graphqlQuery,
variables: { articleId: articleId, corpusId: corpusId },
})
onChange({ corpusId })
Expand Down
4 changes: 2 additions & 2 deletions front/src/components/workspace/WorkspaceSelectItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export default function WorkspaceSelectItem({
async (event) => {
event.preventDefault()
const [id, checked] = [event.target.value, event.target.checked]
const query = checked ? addArticle : removeArticle
const graphqlQuery = checked ? addArticle : removeArticle
await query({
query,
query: graphqlQuery,
variables: { articleId: articleId, workspaceId: id },
})
onChange({ workspaceId: id })
Expand Down

0 comments on commit 3a448e4

Please sign in to comment.