fix(api): harden billing/blog validation and update rc14 changelog
This commit is contained in:
parent
e1d9bb38a3
commit
ad5e9090ee
13 changed files with 168 additions and 53 deletions
|
|
@ -121,6 +121,7 @@ namespace Yavsc.Controllers
|
|||
public async Task<IActionResult> Create(Comment comment)
|
||||
{
|
||||
comment.UserCreated = User.GetUserId();
|
||||
comment.UserModified = comment.UserCreated;
|
||||
// AuthorId/UserCreated is set server-side after model binding;
|
||||
// remove the stale binding error so a valid authenticated POST
|
||||
// does not fall into the invalid branch.
|
||||
|
|
@ -129,7 +130,7 @@ namespace Yavsc.Controllers
|
|||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Comment.Add(comment);
|
||||
await _context.SaveChangesAsync();
|
||||
await _context.SaveChangesAsync(comment.UserCreated);
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
ViewBag.ReceiverId = new SelectList(_context.BlogSpot, "Id", "Title", comment.ReceiverId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue