[FIX] set title in completed progress records
This commit is contained in:
@@ -209,12 +209,7 @@ exports.createProgress = functions.https.onCall((data, context) => {
|
|||||||
const progressDocId = db
|
const progressDocId = db
|
||||||
.collection("progress").doc();
|
.collection("progress").doc();
|
||||||
|
|
||||||
let setTitle;
|
const setTitle = allSetTitles.sort().slice(0, -1).join(", ") + (allSetTitles.length > 1 ? " & " : "") + allSetTitles.sort().slice(-1);
|
||||||
if (allSetTitles.length > 1) {
|
|
||||||
setTitle = allSetTitles.sort().slice(0, -1).join(", ") + " & " + allSetTitles.sort().slice(-1);
|
|
||||||
} else {
|
|
||||||
setTitle = allSetTitles[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
let dataToSet = {
|
let dataToSet = {
|
||||||
questions: [],
|
questions: [],
|
||||||
@@ -583,7 +578,7 @@ exports.processAnswer = functions.https.onCall((data, context) => {
|
|||||||
.then((setDoc) => setDoc.data().title)
|
.then((setDoc) => setDoc.data().title)
|
||||||
.catch((error) => ""))
|
.catch((error) => ""))
|
||||||
);
|
);
|
||||||
const setTitle = allSetTitles.slice(0, -1).join(", ") + " & " + allSetTitles.sort().slice(-1);
|
const setTitle = allSetTitles.slice(0, -1).join(", ") + (allSetTitles.length > 1 ? " & " : "") + allSetTitles.sort().slice(-1);
|
||||||
if (!isCorrectAnswer) transaction.set(incorrectAnswerDoc, {
|
if (!isCorrectAnswer) transaction.set(incorrectAnswerDoc, {
|
||||||
uid: uid,
|
uid: uid,
|
||||||
groups: await userGroups,
|
groups: await userGroups,
|
||||||
|
|||||||
Reference in New Issue
Block a user