Skip to content

Commit 48b714d

Browse files
Merge pull request #75 from MestiriBaha/Inconsistency-in-GraphQl-Query-for-Author-Data
fix(post-details) : Inconsistency in GraphQL Query for Author Data
2 parents 3e15969 + 8d783a9 commit 48b714d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

angular-primeng-app/src/app/components/post-details/post-details.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ <h1 class="title">{{ post.title }}</h1>
77
<div class="author-info">
88
@if (isTeam) {
99
<p-avatarGroup styleClass="mb-3" >
10-
<p-avatar [image]="post.author.profilePicture" size="large" shape="circle" title="{{ post.author.name}}"></p-avatar>
10+
<p-avatar [image]="post.author.profilePicture" size="large" shape="circle" title="{{ post.author.username}}"></p-avatar>
1111
@for (coAuthor of post.coAuthors; track coAuthor.username) {
1212
<p-avatar [image]="coAuthor.profilePicture" size="large" shape="circle" title="{{ coAuthor.username}}"></p-avatar>
1313
}
1414
</p-avatarGroup>
1515
} @else {
16-
<p-avatar [image]="post.author.profilePicture" size="large" shape="circle" title="{{ post.author.name}}"></p-avatar>
16+
<p-avatar [image]="post.author.profilePicture" size="large" shape="circle" title="{{ post.author.username}}"></p-avatar>
1717
}
1818
<div class="author-text">
1919
<span class="author-name">{{post.author.name}} {{isTeam && post.coAuthors.length > 0 ? 'with ' + post.coAuthors.length + ' co-author' + (post.coAuthors.length > 1 ? 's' : '') : ''}}</span>

angular-primeng-app/src/app/graphql.operations.ts

+4
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ export const GET_SINGLE_POST = gql`
136136
name
137137
}
138138
author {
139+
id
139140
name
141+
username
140142
profilePicture
141143
}
142144
coAuthors {
@@ -172,7 +174,9 @@ export const SEARCH_POSTS = gql`
172174
url
173175
}
174176
author {
177+
id
175178
name
179+
username
176180
}
177181
publishedAt
178182
title

angular-primeng-app/src/app/models/post.ts

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export interface Tag {
2424
}
2525

2626
export interface Author {
27+
id : string,
2728
name: string;
29+
username : string ,
2830
profilePicture: string;
2931
socialMediaLinks: SocialMediaLinks;
3032
}

0 commit comments

Comments
 (0)