diff --git a/src/client/src/components/DataSheets/Sections/Enterprise/Direccte/Interactions.gql.js b/src/client/src/components/DataSheets/Sections/Enterprise/Direccte/Interactions.gql.js index be30d166..f1ce8629 100644 --- a/src/client/src/components/DataSheets/Sections/Enterprise/Direccte/Interactions.gql.js +++ b/src/client/src/components/DataSheets/Sections/Enterprise/Direccte/Interactions.gql.js @@ -36,10 +36,10 @@ const interactionsQuery = gql` libellecommune2etablissement } } - interactions_C: fce_interactions_pole_c(where: { siren: { _eq: $siren } }) { - siret - date - unite + interactions_C: fce_interactions_pole_c(where: { SIRNE: { _eq: $siren } }) { + siret: SIRET + date: DATE_DERNIER_CONTROLE + unite: LIB_UC etablissement: interactions_pole_c_siret { etatadministratifetablissement siret diff --git a/src/client/src/components/DataSheets/Sections/Establishment/Dashboard/Dashboard.gql.js b/src/client/src/components/DataSheets/Sections/Establishment/Dashboard/Dashboard.gql.js index 290f3bb4..059dbe76 100644 --- a/src/client/src/components/DataSheets/Sections/Establishment/Dashboard/Dashboard.gql.js +++ b/src/client/src/components/DataSheets/Sections/Establishment/Dashboard/Dashboard.gql.js @@ -43,11 +43,11 @@ const dashboardQuery = gql` siret } fce_interactions_pole_c( - where: { siret: { _eq: $siret } } - order_by: { mois: desc } + where: { SIRET: { _eq: $siret } } + order_by: { DATE_DERNIER_CONTROLE: desc } limit: 1 ) { - date + date: DATE_DERNIER_CONTROLE } fce_interactions_pole_t( where: { siret: { _eq: $siret } } diff --git a/src/client/src/components/DataSheets/Sections/Establishment/Direccte/Controles.gql.js b/src/client/src/components/DataSheets/Sections/Establishment/Direccte/Controles.gql.js index 59c974c7..107dec42 100644 --- a/src/client/src/components/DataSheets/Sections/Establishment/Direccte/Controles.gql.js +++ b/src/client/src/components/DataSheets/Sections/Establishment/Direccte/Controles.gql.js @@ -6,20 +6,20 @@ import { mapQueryResult } from "../../../../../utils/graphql/graphql"; import { // normalizeInteractions3E, // normalizeInteractions3ESRC, - // normalizeInteractionsC, + normalizeInteractionsC, normalizeInteractionsT, } from "../../../../../utils/interactions/interactions"; const controlesQuery = gql` query getControles($siret: String!) { - # fce_interactions_pole_c(where: { siret: { _eq: $siret } }) { - # unite - # siret - # date - # interactions_pole_c_siret { - # denominationusuelleetablissement - # } - # } + fce_interactions_pole_c(where: { SIRET: { _eq: $siret } }) { + siret: SIRET + date: DATE_DERNIER_CONTROLE + unite: LIB_UC + interactions_pole_c_siret { + denominationusuelleetablissement + } + } fce_interactions_pole_t(where: { siret: { _eq: $siret } }) { date intervenant @@ -49,14 +49,14 @@ const controlesQuery = gql` const normalizeResponsesToInteraction = ({ // fce_interactions_pole_3e, // fce_interactions_pole_3e_src, - // fce_interactions_pole_c, + fce_interactions_pole_c, fce_interactions_pole_t, }) => ({ // interactions_pole_3e: normalizeInteractions3E(fce_interactions_pole_3e), // interactions_pole_3e_src: normalizeInteractions3ESRC( // fce_interactions_pole_3e_src // ), - // interactions_pole_c: normalizeInteractionsC(fce_interactions_pole_c), + interactions_pole_c: normalizeInteractionsC(fce_interactions_pole_c), interactions_pole_t: normalizeInteractionsT(fce_interactions_pole_t), });