-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(contributions): desactive la logique sur les CCs qui ne prévoit r…
…ien qui renvoie vers le CDT qui prévoit rien (#1230) * fix: test * fix: test * fix: test * fix: test * fix: test
- Loading branch information
Showing
16 changed files
with
107 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 0 additions & 68 deletions
68
targets/export-elasticsearch/src/ingester/contributions/fetchContributionsWithNoContent.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
targets/export-elasticsearch/src/ingester/contributions/getCcSupportedWithNoContent.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
targets/frontend/src/components/contributions/answers/answerGeneric.query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { useQuery } from "urql"; | ||
import { AnswerWithStatus } from "./answer.query"; | ||
|
||
const contributionGenericAnswerQuery = ` | ||
query contribution_answer($questionId: uuid) { | ||
contribution_answers(where: {question_id: {_eq: $questionId}, agreement_id: {_eq: "0000"}}) { | ||
contentType: content_type | ||
} | ||
} | ||
`; | ||
|
||
type QueryProps = { | ||
questionId?: string; | ||
}; | ||
|
||
type QueryResult = { | ||
contribution_answers: AnswerWithStatus[]; | ||
}; | ||
|
||
export const useGenericContributionAnswerQuery = ({ | ||
questionId, | ||
}: QueryProps): Pick<AnswerWithStatus, "contentType"> | undefined => { | ||
const [resultGeneric] = useQuery<QueryResult>({ | ||
query: contributionGenericAnswerQuery, | ||
variables: { | ||
questionId, | ||
}, | ||
}); | ||
const genericAnswer = resultGeneric.data?.contribution_answers[0]; | ||
if (!genericAnswer) { | ||
return; | ||
} | ||
return genericAnswer; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.