diff --git a/targets/alert-cli/src/diff/sp/getContributionsWithFicheSp.ts b/targets/alert-cli/src/diff/sp/getContributionsWithFicheSp.ts index 63acdd8ab..49780b2a0 100644 --- a/targets/alert-cli/src/diff/sp/getContributionsWithFicheSp.ts +++ b/targets/alert-cli/src/diff/sp/getContributionsWithFicheSp.ts @@ -11,7 +11,7 @@ query getContribsWithSp($ficheSpIds: [String!]) { order seo_title } - content_fiche_sp: document { + content_fiche_sp: document_fiche_sp { initial_id document } diff --git a/targets/frontend/src/components/contributions/answers/answer.query.ts b/targets/frontend/src/components/contributions/answers/answer.query.ts index 9dd715d29..266bb2b09 100644 --- a/targets/frontend/src/components/contributions/answers/answer.query.ts +++ b/targets/frontend/src/components/contributions/answers/answer.query.ts @@ -77,7 +77,7 @@ query contribution_answer($id: uuid) { slug } } - contentFichesSpDocument: document { + contentFichesSpDocument: document_fiche_sp { cdtnId: cdtn_id title source diff --git a/targets/frontend/src/modules/contribution/api/query.ts b/targets/frontend/src/modules/contribution/api/query.ts index 90a6707f7..1c3fbd737 100644 --- a/targets/frontend/src/modules/contribution/api/query.ts +++ b/targets/frontend/src/modules/contribution/api/query.ts @@ -45,7 +45,7 @@ export const getContributionAnswerById = gql` cdtn_references { cdtn_id } - content_fiche_sp: document { + content_fiche_sp: document_fiche_sp { initial_id document } @@ -70,7 +70,7 @@ export const getGenericAnswerByQuestionId = gql` order seo_title } - content_fiche_sp: document { + content_fiche_sp: document_fiche_sp { initial_id document } diff --git a/targets/hasura/metadata/databases/default/tables/contribution_answers.yaml b/targets/hasura/metadata/databases/default/tables/contribution_answers.yaml index e609c8817..5bb26ba9f 100644 --- a/targets/hasura/metadata/databases/default/tables/contribution_answers.yaml +++ b/targets/hasura/metadata/databases/default/tables/contribution_answers.yaml @@ -15,6 +15,9 @@ object_relationships: - name: document using: foreign_key_constraint_on: cdtn_id + - name: document_fiche_sp + using: + foreign_key_constraint_on: content_service_public_cdtn_id - name: question using: foreign_key_constraint_on: question_id