mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-26 15:54:35 +08:00
Merge branch 'master' of https://github.com/Miodec/monkeytype
This commit is contained in:
commit
632b7e4bf6
3 changed files with 9 additions and 6 deletions
2
.github/workflows/pr-check.yml
vendored
2
.github/workflows/pr-check.yml
vendored
|
@ -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'
|
||||
|
||||
|
|
|
@ -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<MonkeyTypesResult> {
|
||||
export async function getLastResult(
|
||||
uid: string
|
||||
): Promise<Partial<MonkeyTypesResult>> {
|
||||
const [lastResult] = await db
|
||||
.collection<MonkeyTypesResult>("results")
|
||||
.find({ uid })
|
||||
|
@ -73,7 +76,7 @@ export async function getLastResult(uid: string): Promise<MonkeyTypesResult> {
|
|||
.limit(1)
|
||||
.toArray();
|
||||
if (!lastResult) throw new MonkeyError(404, "No results found");
|
||||
return lastResult;
|
||||
return _.omit(lastResult, "uid");
|
||||
}
|
||||
|
||||
export async function getResultByTimestamp(
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue