summaryrefslogtreecommitdiffstats
path: root/src/ts
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-18 16:07:44 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-18 16:07:44 +0100
commit2ff898626c5c0abc6b8195224067b992403e313b (patch)
tree53e33f9b49f08721a086466c19bc4a2141f79215 /src/ts
parenta4058ef96e9bd87bfc9a2434bb0b3745696086eb (diff)
chore: add subject view
Diffstat (limited to 'src/ts')
-rw-r--r--src/ts/types/taxonomies.ts41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/ts/types/taxonomies.ts b/src/ts/types/taxonomies.ts
index d090e2d..a8c372c 100644
--- a/src/ts/types/taxonomies.ts
+++ b/src/ts/types/taxonomies.ts
@@ -1,5 +1,5 @@
import { ArticlePreview, ArticlePreviewResponse } from './articles';
-import { Cover } from './cover';
+import { Cover, CoverResponse } from './cover';
type TaxonomyPreview = {
databaseId: number;
@@ -17,7 +17,7 @@ export type Taxonomy = TaxonomyPreview & {
};
export type SubjectPreview = TaxonomyPreview & {
- cover: Cover;
+ featuredImage: Cover;
};
export type ThematicPreview = TaxonomyPreview;
@@ -42,7 +42,7 @@ export type AllTaxonomiesSlug = {
slug: string;
};
-export type AllTaxonomiesSlugResponse = {
+export type AllThematicsSlugResponse = {
thematics: {
nodes: AllTaxonomiesSlug[];
};
@@ -59,3 +59,38 @@ export type FetchThematicByReturn = (
export type GetTaxonomyByReturn = (slug: string) => Promise<Taxonomy>;
export type FetchAllTaxonomiesSlugReturn = () => Promise<AllTaxonomiesSlug[]>;
+
+export type Subject = Taxonomy & {
+ featuredImage: Cover;
+ officialWebsite: string;
+};
+
+export type SubjectResponse = SubjectPreview & {
+ acfSubjects: {
+ postsInSubject: ArticlePreviewResponse[];
+ };
+ contentParts: {
+ afterMore: string;
+ beforeMore: string;
+ };
+ date: string;
+ featuredImage: CoverResponse;
+ modified: string;
+ officialWebsite: string;
+};
+
+export type SubjectProps = {
+ subject: Subject;
+};
+
+export type SubjectByResponse = {
+ subjectBy: SubjectResponse;
+};
+
+export type FetchSubjectByReturn = (slug: string) => Promise<SubjectByResponse>;
+
+export type AllSubjectsSlugResponse = {
+ subjects: {
+ nodes: AllTaxonomiesSlug[];
+ };
+};