Skip to content

Commit

Permalink
fix(comments): fix comment author mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
undrcrxwn authored Feb 10, 2024
1 parent 0b2800f commit 200b4c4
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,26 @@ public async Task<CommentDto> CreateAsync(Guid authorId, Guid discussionId, stri
(comment:Comment {
Id: randomUUID(),
Content: $content,
CreatedAt: datetime()
})
""")
.Create("(discussion)<-[:REPLIES_TO]-(comment)-[:AUTHORED_BY]->(author)")
.With(
"""
{
Id: comment.Id,
Content: comment.Content,
Author: {
Id: author.Id,
Username: author.Username,
DisplayName: author.DisplayName,
AvatarUrl: author.AvatarUrl
},
CreatedAt: datetime()
})
""")
.Create("(discussion)<-[:REPLIES_TO]-(comment)-[:AUTHORED_BY]->(author)")
CreatedAt: datetime(comment.CreatedAt)
}
AS comment
"""
)
.Return<CommentDto>("comment")
.ResultsAsync;

Expand Down

0 comments on commit 200b4c4

Please sign in to comment.