filling default values

This commit is contained in:
Miodec 2022-10-17 13:32:52 +02:00
parent b13448ae7c
commit f0dca0cf13

View file

@ -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", {