The blogspot iis now in the PostIt app,
All checks were successful
Dotnet build and test / build (pull_request) Successful in 21m55s

no more creation/edition from here
This commit is contained in:
Paul Schneider 2026-09-21 10:40:49 +01:00
commit efc2296858
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
7 changed files with 2 additions and 292 deletions

View file

@ -90,73 +90,6 @@ namespace Yavsc.Org.Controllers
);
}
// GET: Blog/Create
[Authorize()]
public IActionResult Create(string title)
{
var result = new BlogPostEditViewModel
(new Models.Blog.BlogPost
{
Title = title
}, true);
SetLangItems();
return View(result);
}
// POST: Blog/Create
[HttpPost, Authorize, ValidateAntiForgeryToken]
public IActionResult Create(Models.Blog.BlogPost blogInput)
{
if (ModelState.IsValid)
{
var uid = User.GetUserId();
Models.Blog.BlogPost post = blogSpotService.Create(uid, blogInput);
blogSpotService.AttachFiles(Request.Form.Files, uid, post.Id);
return RedirectToAction("Index");
}
return View("Edit", blogInput);
}
[Authorize()]
// GET: Blog/Edit/5
public async Task<IActionResult> Edit(long? id)
{
if (id == null)
{
return NotFound();
}
try
{
var blog = await blogSpotService.GetPostForEdition(User, id.Value);
if (blog == null)
{
return NotFound();
}
SetLangItems();
return View(blog);
}
catch (AuthorizationFailureException)
{
return new ChallengeResult();
}
}
// POST: Blog/Edit/5
[HttpPost]
[ValidateAntiForgeryToken, Authorize()]
public async Task<IActionResult> Edit(BlogPostEditViewModel blogEdit)
{
if (ModelState.IsValid)
{
await blogSpotService.Modify(User, blogEdit);
ViewBag.StatusMessage = "Post modified";
return RedirectToAction("Index");
}
return View(blogEdit);
}
// GET: Blog/Delete/5
[ActionName("Delete"), Authorize()]