htmx display
This commit is contained in:
1 parent
e596952955
commit
96d08d9405
4 files changed
+127
No files matched your search
@@ -0,0 +1,29 @@
|
||||
namespace Twinty.Controllers;
|
||||
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
public class CreateCommentRequest{
|
||||
public string Name { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
|
||||
public class CreateCommentResponse{
|
||||
public bool? Succeed { get; set; }
|
||||
}
|
||||
|
||||
public class CommentsController : Controller{
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Index(){
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionName("create-comment")]
|
||||
public IActionResult CreateComment([FromBody] CreateCommentRequest req){
|
||||
ViewData["Name"] = req.Name;
|
||||
ViewData["Comment"] = req.Comment;
|
||||
return View("PartialComment");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user