Update updateRequestScore endpoint and clean up naming
This commit is contained in:
parent
54a7145630
commit
36d3871bdc
6 changed files with 19 additions and 12 deletions
|
@ -128,7 +128,7 @@ app.post("/api/updateRequestState", async (request, response) => {
|
|||
.catch((e: any) => errorHandler(request,response,e));
|
||||
});
|
||||
|
||||
app.post("/api/updateRequestScore", async (request, response) => {
|
||||
app.post("/api/updateRequestScoreModifier", async (request, response) => {
|
||||
if (request.session) await validateApiToken(request.session);
|
||||
if (!request.session || !request.session.user) {
|
||||
response.status(401);
|
||||
|
@ -154,7 +154,7 @@ app.post("/api/updateRequestScore", async (request, response) => {
|
|||
var url = request.body.url as string;
|
||||
var scoreDiff = parseInt(request.body.scoreDiff as string, 10);
|
||||
response.type('text/plain');
|
||||
requests.updateRequestScore(url,scoreDiff).then((val: [number,string]) => {
|
||||
requests.updateRequestScoreModifier(url,scoreDiff).then((val: [number,string]) => {
|
||||
response.status(val[0]);
|
||||
response.send(val[1]);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue