diff --git a/Controllers/GetPosts.cs b/Controllers/GetPosts.cs index c548591..bd5900c 100644 --- a/Controllers/GetPosts.cs +++ b/Controllers/GetPosts.cs @@ -5,7 +5,7 @@ namespace NeDvachAPI.Controllers { [ApiController] [Route("[controller]")] - public class HomeController : ControllerBase + public class ListController : ControllerBase { [HttpGet(Name = "GetPosts")] public string Get() @@ -13,6 +13,7 @@ namespace NeDvachAPI.Controllers Post[] posts = DBchat.DbList(); string postsJson = JsonSerializer.Serialize(posts); return postsJson ; + } } } diff --git a/Controllers/PostPost.cs b/Controllers/PostPost.cs index ed270da..279fe82 100644 --- a/Controllers/PostPost.cs +++ b/Controllers/PostPost.cs @@ -7,10 +7,9 @@ namespace NeDvachAPI.Controllers [Route("[controller]")] public class PostToController : ControllerBase { - [HttpGet(Name = "PostPosts")] - public void ReceivePost(string postJson) + [HttpPost(Name = "PostPosts")] + public void ReceivePost([FromBody] Post ReceivedPost) { - Post ReceivedPost = JsonSerializer.Deserialize(postJson); DBchat.SendPost(ReceivedPost); } } diff --git a/bin/Debug/net6.0/NeDvachAPI.dll b/bin/Debug/net6.0/NeDvachAPI.dll index f908985..a9f8857 100644 Binary files a/bin/Debug/net6.0/NeDvachAPI.dll and b/bin/Debug/net6.0/NeDvachAPI.dll differ diff --git a/bin/Debug/net6.0/NeDvachAPI.pdb b/bin/Debug/net6.0/NeDvachAPI.pdb index 5f6b5ed..18ae9d9 100644 Binary files a/bin/Debug/net6.0/NeDvachAPI.pdb and b/bin/Debug/net6.0/NeDvachAPI.pdb differ diff --git a/obj/Debug/net6.0/NeDvachAPI.dll b/obj/Debug/net6.0/NeDvachAPI.dll index f908985..a9f8857 100644 Binary files a/obj/Debug/net6.0/NeDvachAPI.dll and b/obj/Debug/net6.0/NeDvachAPI.dll differ diff --git a/obj/Debug/net6.0/NeDvachAPI.pdb b/obj/Debug/net6.0/NeDvachAPI.pdb index 5f6b5ed..18ae9d9 100644 Binary files a/obj/Debug/net6.0/NeDvachAPI.pdb and b/obj/Debug/net6.0/NeDvachAPI.pdb differ diff --git a/obj/Debug/net6.0/ref/NeDvachAPI.dll b/obj/Debug/net6.0/ref/NeDvachAPI.dll index d4ff6ce..eb8957c 100644 Binary files a/obj/Debug/net6.0/ref/NeDvachAPI.dll and b/obj/Debug/net6.0/ref/NeDvachAPI.dll differ diff --git a/obj/Debug/net6.0/refint/NeDvachAPI.dll b/obj/Debug/net6.0/refint/NeDvachAPI.dll index d4ff6ce..eb8957c 100644 Binary files a/obj/Debug/net6.0/refint/NeDvachAPI.dll and b/obj/Debug/net6.0/refint/NeDvachAPI.dll differ diff --git a/obj/staticwebassets.pack.sentinel b/obj/staticwebassets.pack.sentinel index cb53157..debb8a5 100644 --- a/obj/staticwebassets.pack.sentinel +++ b/obj/staticwebassets.pack.sentinel @@ -1,3 +1,15 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0