fix(postit): preserve newly created blog posts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-22 23:19:45 +00:00
commit d86ea87d59
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
7 changed files with 52 additions and 14 deletions

View file

@ -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,