Skip to content

Commit

Permalink
filter ignored fields when copying exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonJAC committed Sep 20, 2024
1 parent 03fb46e commit 0edab2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/store/exercise/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ export default {
data.favouriteOf = arrayUnion(rootState.auth.currentUser.uid);
data.createdBy = rootState.auth.currentUser.uid;
data.createdAt = serverTimestamp();

const ignoreFields = ['_applicationRecords', '_applications', '_approval', 'testingState'];
for (const key in data) {
if (ignoreFields.includes(key)) {
delete data[key];
}
}

transaction.set(exerciseRef, getExerciseSaveData(data, data));
return exerciseRef.id;
});
Expand Down

0 comments on commit 0edab2c

Please sign in to comment.