From d7862750cea91eb08e86bae9ed6652ea31f7f309 Mon Sep 17 00:00:00 2001 From: Bruce Berrios <58147810+Bruception@users.noreply.github.com> Date: Thu, 19 May 2022 12:45:17 -0400 Subject: [PATCH 1/2] Remove lua (#2996) --- .github/workflows/pr-check.yml | 2 +- package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index bbede3557..e89245be6 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -40,7 +40,7 @@ jobs: anti-cheat: - 'backend/**/anticheat/**' any-src: - - 'backend/**/*.{ts,js,json,lua}' + - 'backend/**/*.{ts,js,json}' - 'frontend/**/*.{ts,js}' - 'frontend/src/**/*.scss' diff --git a/package.json b/package.json index 395c61ff0..6b49d4ec2 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "audit-fe": "cd frontend && npm run audit", "deploy-live": "cd frontend && npm run deploy-live", "build-fe": "cd ./frontend && npm run build-live", - "pretty": "prettier --check './backend/**/*.{ts,json,lua}' './frontend/**/*.{ts,js,scss}' './frontend/static/**/*.{json,html}'", - "pretty-code": "prettier --check './backend/**/*.{ts,js,json,lua}' './frontend/**/*.{ts,js}' './frontend/src/**/*.scss'", - "pretty-fix": "prettier --write './backend/**/*.{ts,json,lua}' './frontend/**/*.{ts,js,scss}' './frontend/static/**/*.{json,html}'", + "pretty": "prettier --check './backend/**/*.{ts,json}' './frontend/**/*.{ts,js,scss}' './frontend/static/**/*.{json,html}'", + "pretty-code": "prettier --check './backend/**/*.{ts,js,json}' './frontend/**/*.{ts,js}' './frontend/src/**/*.scss'", + "pretty-fix": "prettier --write './backend/**/*.{ts,json}' './frontend/**/*.{ts,js,scss}' './frontend/static/**/*.{json,html}'", "pr-check-lint-json": "cd frontend && npx gulp pr-check-lint-json", "pr-check-quote-json": "cd frontend && npx gulp pr-check-quote-json", "pr-check-language-json": "cd frontend && npx gulp pr-check-language-json", From 294ff4c95aa309bc8bd7a9e1f96306bf1aa1caf5 Mon Sep 17 00:00:00 2001 From: Bruce Berrios <58147810+Bruception@users.noreply.github.com> Date: Thu, 19 May 2022 14:44:24 -0400 Subject: [PATCH 2/2] Remove uid from last result (#2998) --- backend/src/dal/result.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/dal/result.ts b/backend/src/dal/result.ts index 8fde914cb..c1e34782b 100644 --- a/backend/src/dal/result.ts +++ b/backend/src/dal/result.ts @@ -1,3 +1,4 @@ +import _ from "lodash"; import { DeleteResult, ObjectId, UpdateResult } from "mongodb"; import MonkeyError from "../utils/error"; import * as db from "../init/db"; @@ -65,7 +66,9 @@ export async function getResult( return result; } -export async function getLastResult(uid: string): Promise { +export async function getLastResult( + uid: string +): Promise> { const [lastResult] = await db .collection("results") .find({ uid }) @@ -73,7 +76,7 @@ export async function getLastResult(uid: string): Promise { .limit(1) .toArray(); if (!lastResult) throw new MonkeyError(404, "No results found"); - return lastResult; + return _.omit(lastResult, "uid"); } export async function getResultByTimestamp(