54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
using System.Net;
|
|
|
|
namespace Server;
|
|
|
|
public class UpdatePost : UpdateRoute
|
|
{
|
|
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
|
|
{
|
|
List<string> validParamNames =
|
|
[
|
|
"f_name",
|
|
"l_name",
|
|
"company",
|
|
"website",
|
|
"location",
|
|
"github",
|
|
"status",
|
|
"bio",
|
|
"skills",
|
|
"twitter",
|
|
"facebook",
|
|
"youtube",
|
|
"linkedin",
|
|
"instagram",
|
|
"id",
|
|
];
|
|
|
|
try
|
|
{
|
|
UpdateDb(request, "post", validParamNames, true);
|
|
SendSuccess(response);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SendError(response, ex);
|
|
}
|
|
}
|
|
|
|
public static void HandleLikes(HttpListenerRequest request, HttpListenerResponse response)
|
|
{
|
|
List<string> validParamNames = ["id"];
|
|
|
|
try
|
|
{
|
|
UpdateLikes(request, "post", validParamNames, true);
|
|
SendSuccess(response);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SendError(response, ex);
|
|
}
|
|
}
|
|
}
|