mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 04:19:06 +08:00
converted to ts
This commit is contained in:
parent
6370f6a624
commit
5b0f170b10
1 changed files with 6 additions and 6 deletions
|
@ -36,13 +36,13 @@ try {
|
|||
}
|
||||
|
||||
class ResultController {
|
||||
static async getResults(req, _res) {
|
||||
static async getResults(req: MonkeyTypes.Request): Promise<MonkeyResponse> {
|
||||
const { uid } = req.ctx.decodedToken;
|
||||
const results = await ResultDAO.getResults(uid);
|
||||
return new MonkeyResponse("Result retrieved", results);
|
||||
}
|
||||
|
||||
static async deleteAll(req, _res) {
|
||||
static async deleteAll(req: MonkeyTypes.Request): Promise<MonkeyResponse> {
|
||||
const { uid } = req.ctx.decodedToken;
|
||||
|
||||
await ResultDAO.deleteAll(uid);
|
||||
|
@ -50,7 +50,7 @@ class ResultController {
|
|||
return new MonkeyResponse("All results deleted");
|
||||
}
|
||||
|
||||
static async updateTags(req, _res) {
|
||||
static async updateTags(req: MonkeyTypes.Request): Promise<MonkeyResponse> {
|
||||
const { uid } = req.ctx.decodedToken;
|
||||
const { tagIds, resultId } = req.body;
|
||||
|
||||
|
@ -58,7 +58,7 @@ class ResultController {
|
|||
return new MonkeyResponse("Result tags updated");
|
||||
}
|
||||
|
||||
static async addResult(req, _res) {
|
||||
static async addResult(req: MonkeyTypes.Request): Promise<MonkeyResponse> {
|
||||
const { uid } = req.ctx.decodedToken;
|
||||
const { result } = req.body;
|
||||
result.uid = uid;
|
||||
|
@ -71,7 +71,7 @@ class ResultController {
|
|||
throw new MonkeyError(status.code, status.message);
|
||||
}
|
||||
|
||||
let resulthash = result.hash;
|
||||
const resulthash = result.hash;
|
||||
delete result.hash;
|
||||
if (
|
||||
req.ctx.configuration.resultObjectHashCheck.enabled &&
|
||||
|
@ -277,7 +277,7 @@ class ResultController {
|
|||
|
||||
if (result.mode !== "custom") delete result.customText;
|
||||
|
||||
let addedResult = await ResultDAO.addResult(uid, result);
|
||||
const addedResult = await ResultDAO.addResult(uid, result);
|
||||
|
||||
if (isPb) {
|
||||
Logger.log(
|
Loading…
Reference in a new issue