diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-15 19:17:11 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-15 19:26:26 +0100 |
| commit | 94f1c1fbea903e677476a167e51b549bb0c53330 (patch) | |
| tree | 3e0ac1c6acab52b3d31a8130788d39b2c0f9984e /src/services | |
| parent | 3760b757f8fd35eafc340a43f7980ab954413f4e (diff) | |
chore: create legal notice view
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/graphql/pages.ts | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/services/graphql/pages.ts b/src/services/graphql/pages.ts index 6689e37..0781d44 100644 --- a/src/services/graphql/pages.ts +++ b/src/services/graphql/pages.ts @@ -1,6 +1,6 @@ import { FetchPageByUriReturn, - GetCVPageReturn, + GetPageReturn, Page, PageResponse, RawPage, @@ -35,14 +35,26 @@ const fetchPageByUri: FetchPageByUriReturn = async (uri: string) => { } }; -export const getCVPage: GetCVPageReturn = async () => { - const rawCV = await fetchPageByUri('/cv/'); - - const formattedCV: Page = { - ...rawCV, - content: rawCV.contentParts.afterMore, - intro: rawCV.contentParts.beforeMore, +const getFormattedPage = (page: RawPage) => { + const formattedPage: Page = { + ...page, + content: page.contentParts.afterMore, + intro: page.contentParts.beforeMore, }; + return formattedPage; +}; + +export const getCVPage: GetPageReturn = async () => { + const rawCV = await fetchPageByUri('/cv/'); + const formattedCV = getFormattedPage(rawCV); + return formattedCV; }; + +export const getLegalNoticePage: GetPageReturn = async () => { + const rawLegalNotice = await fetchPageByUri('/mentions-legales'); + const formattedLegalNotice = getFormattedPage(rawLegalNotice); + + return formattedLegalNotice; +}; |
