Skip to content

Commit

Permalink
feat: add sp doc type
Browse files Browse the repository at this point in the history
  • Loading branch information
victor committed Jul 10, 2024
1 parent d597467 commit 222f096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions shared/types/src/elastic/fiche-sp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { FicheServicePublic } from "../hasura";

export type FicheSPDocument = FicheServicePublic & { raw: string };
1 change: 1 addition & 0 deletions shared/types/src/elastic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from "./common";
export * from "./prequalified";
export * from "./tools";
export * from "./editorial-content";
export * from "./fiche-sp";
6 changes: 5 additions & 1 deletion targets/export-elasticsearch/src/ingester/cdtnDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
FicheTravailEmploiDoc,
DocumentElasticWithSource,
DocumentRef,
FicheSPDocument,
} from "@socialgouv/cdtn-types";
import { logger } from "@shared/utils";
import { SOURCES } from "@socialgouv/cdtn-sources";
Expand Down Expand Up @@ -166,7 +167,10 @@ export async function cdtnDocumentsGen(
await updateDocs(SOURCES.CCN, agreementsDocs);

logger.info("=== Fiches SP ===");
const fichesSp = await getDocumentBySource(SOURCES.SHEET_SP, getBreadcrumbs);
const fichesSp = await getDocumentBySource<FicheSPDocument>(
SOURCES.SHEET_SP,
getBreadcrumbs
);

documentsCount = {
...documentsCount,
Expand Down

0 comments on commit 222f096

Please sign in to comment.