Skip to content

Commit d56e6ff

Browse files
authored
feat(bff): add titles field to authors & articles objects (#315)
just bff
1 parent 2a7fe59 commit d56e6ff

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

libs/blog-bff/articles/api/src/lib/dtos.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface WPPostDetailsDto {
7070
github: string;
7171
twitter: string;
7272
linkedin: string;
73+
titles: string[];
7374
};
7475
acf: {
7576
reading_time: string | number;

libs/blog-bff/articles/api/src/lib/mappers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export const toArticle = (dto?: WPPostDetailsDto): Article => {
117117
github: dto?.author_details?.github || null,
118118
twitter: dto?.author_details?.twitter || null,
119119
linkedin: dto?.author_details?.linkedin || null,
120+
titles: dto?.author_details?.titles || [],
120121
},
121122
content: highlightedContent,
122123
anchors: anchors,

libs/blog-bff/articles/api/src/lib/wp-posts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class WpPosts {
5050
.join(',');
5151

5252
return this._wpClient.get<WPPostDetailsDto>(`posts/${slug}`, {
53-
_fields: `id,type,slug,title.rendered,author,content.rendered,date,featured_image_url,author_details,acf,other_translations,lang,${yoast_props}`,
53+
_fields: `id,type,slug,title.rendered,author,content.rendered,date,featured_image_url,author_details,acf,other_translations,lang,author_details.al_titles${yoast_props}`,
5454
});
5555
}
5656
}

libs/blog-bff/authors/api/src/lib/dtos.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface WPAuthorDto {
99
al_github_nickname: string;
1010
al_twitter_handle: string;
1111
al_linkedin_id: string;
12+
al_titles: string[];
1213
user_description_pl: string;
1314
user_description_en: string;
1415
};

libs/blog-bff/authors/api/src/lib/mappers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ export const toAuthor = (dto: WPAuthorDto): Author => {
1515
github: dto.acf.al_github_nickname || null,
1616
twitter: dto.acf.al_twitter_handle || null,
1717
linkedin: dto.acf.al_linkedin_id || null,
18+
titles: dto.acf.al_titles,
1819
};
1920
};

libs/blog-bff/authors/api/src/lib/wp-authors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export class WpAuthors {
1010
): Promise<WPResponse<WPAuthorDto[]>> {
1111
return this._wpClient.get<WPAuthorDto[]>('users', {
1212
...query,
13-
_fields: 'id,type,slug,name,description,avatar_urls,acf',
13+
_fields: 'id,type,slug,name,description,avatar_urls,acf,titles',
1414
});
1515
}
1616

1717
async getBySlug(slug: string): Promise<WPResponse<WPAuthorDto[]>> {
1818
return this._wpClient.get<WPAuthorDto[]>('users', {
1919
slug: slug,
20-
_fields: 'id,type,slug,name,description,avatar_urls,acf',
20+
_fields: 'id,type,slug,name,description,avatar_urls,acf,titles',
2121
acf_format: 'standard',
2222
});
2323
}

0 commit comments

Comments
 (0)