From f564d181bc428e25a02bf1d98c4449a6b3eb8e9e Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 28 Nov 2023 16:18:03 +0100 Subject: fix(services,types): make coherent Thematic type and query * some nodes was queried but missing in the Thematic type and vice versa, it is now fixed * add tests for all thematics fetchers --- src/types/data.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/types/data.ts') diff --git a/src/types/data.ts b/src/types/data.ts index 9a6d674..c582709 100644 --- a/src/types/data.ts +++ b/src/types/data.ts @@ -57,6 +57,8 @@ export type WPImage = { type WPInfo = { wordsCount: number }; type WPContent = { + contentParts: WPContentParts; + databaseId: number; date: string; featuredImage: Nullable>; modified: string; @@ -66,7 +68,6 @@ type WPContent = { }; export type WPPage = WPContent & { - contentParts: WPContentParts; info: WPInfo; }; @@ -81,8 +82,6 @@ export type WPPost = WPContent & { acfPosts: Nullable>; author: GraphQLNode; commentCount: Nullable; - contentParts: WPContentParts; - databaseId: number; info: WPInfo; }; @@ -118,9 +117,10 @@ export type WPThematic = WPContent & { acfThematics: Nullable; }; -export type WPThematicPreview = Pick & { - databaseId: number; -}; +export type WPThematicPreview = Pick< + WPThematic, + 'databaseId' | 'slug' | 'title' +>; type WPAcfTopics = { officialWebsite: string; @@ -133,10 +133,8 @@ export type WPTopic = WPContent & { export type WPTopicPreview = Pick< WPTopic, - 'featuredImage' | 'slug' | 'title' -> & { - databaseId: number; -}; + 'databaseId' | 'featuredImage' | 'slug' | 'title' +>; //=========================================================================== // Data from MDX files -- cgit v1.2.3