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/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( 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",