fighting weird bug with branches
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Net;
|
||||
|
||||
namespace Server;
|
||||
|
||||
public class UpdateComment : UpdateRoute
|
||||
{
|
||||
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<string> validParamNames = ["message", "post", "id"];
|
||||
|
||||
UpdateDb(request, "comment", validParamNames, true);
|
||||
SendSuccess(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SendError(response, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void LikeComment(HttpListenerRequest request, HttpListenerResponse response)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<string> validParamNames = ["likes", "id"];
|
||||
|
||||
UpdateDb(request, "comment", validParamNames, true);
|
||||
SendSuccess(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SendError(response, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user