fix(postit): preserve newly created blog posts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
82095f4435
commit
d86ea87d59
7 changed files with 52 additions and 14 deletions
|
|
@ -110,6 +110,7 @@ public class BlogSpotService
|
|||
// Sauvegarder le post d'abord pour obtenir son ID
|
||||
// Le créateur vient de l'authentification, donc on ne le prend pas du post
|
||||
post.AuthorId = userId;
|
||||
post.Author = _context.Users.Single(u => u.Id == userId);
|
||||
_context.BlogSpot.Add(post);
|
||||
_context.SaveChanges(userId);
|
||||
// A freshly created post has no BlogSpotPublication row,
|
||||
|
|
|
|||
Loading…
Reference in a new issue