Skip to content

Commit

Permalink
Can post with display name on new ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
RETprojects committed Jun 23, 2024
1 parent 8d1932e commit 0697f7f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function CommentForm(props) {
setTextChange('');
// render the comment in the comment feed
props.renderNewComment(data);
console.log(props);
} catch (error) {
console.error(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ function useForceUpdate() {
function DisplayComments(props) {
const commentNodes = props.comments.map((comment) => {
const commentUser = cleanData(comment.user?.data);
console.log(commentUser.profile.data.attributes.displayName);
console.log(comment.author);
return (
<Comment
user={commentUser}
author={comment.author}
// author={comment.author}
author={commentUser.profile.data.attributes.displayName}
key={comment.id}
id={comment.id}
createdAt={comment.createdAt}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export const useFetchIdea = (ideaId, setComments) => {
const data = cleanData(
await agent.Ideas.getIdea(
ideaId,
new URLSearchParams(`populate=deep`)
new URLSearchParams(
`populate[ideaOwner][populate]&populate[author][populate]&populate[comments][populate][user][populate]=profile`
)
)
);

Expand Down
2 changes: 1 addition & 1 deletion packages/UI/src/context/UserDataContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function useUserDataHook() {
console.log('Fetching...');
setUserData({
id: currentUser.id,
name: currentUser.profile.displayName,
name: currentUser.profile.name,
username: currentUser.username,
email: currentUser.email,
bio: currentUser.profile.bio,
Expand Down

0 comments on commit 0697f7f

Please sign in to comment.