summaryrefslogtreecommitdiffstats
path: root/src/services/graphql/pages.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/graphql/pages.ts')
-rw-r--r--src/services/graphql/pages.ts28
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;
+};