mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 01:06:21 +08:00
filling default values
This commit is contained in:
parent
b13448ae7c
commit
f0dca0cf13
1 changed files with 17 additions and 0 deletions
|
|
@ -87,6 +87,23 @@ export async function updateTags(
|
|||
|
||||
await ResultDAL.updateTags(uid, resultId, tagIds);
|
||||
const result = await ResultDAL.getResult(uid, resultId);
|
||||
|
||||
if (!result.difficulty) {
|
||||
result.difficulty = "normal";
|
||||
}
|
||||
if (!result.language) {
|
||||
result.language = "english";
|
||||
}
|
||||
if (!result.funbox) {
|
||||
result.funbox = "none";
|
||||
}
|
||||
if (!result.lazyMode) {
|
||||
result.lazyMode = false;
|
||||
}
|
||||
if (!result.punctuation) {
|
||||
result.punctuation = false;
|
||||
}
|
||||
|
||||
const user = await getUser(uid, "update tags");
|
||||
const tagPbs = await checkIfTagPb(uid, user, result);
|
||||
return new MonkeyResponse("Result tags updated", {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue