@kipicore/dbcore 1.1.77 → 1.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -122,7 +122,7 @@ const examHasAnswerSheetSchema = new mongoose_1.Schema({
|
|
|
122
122
|
});
|
|
123
123
|
// Add a pre-save hook to validate examId existence
|
|
124
124
|
examHasAnswerSheetSchema.pre('save', async function (next) {
|
|
125
|
-
const examExists = await examModel_1.default.findOne({
|
|
125
|
+
const examExists = await examModel_1.default.findOne({ id: this.examId });
|
|
126
126
|
if (!examExists) {
|
|
127
127
|
return next(new Error(errorMessages_1.EXAM_ERROR_MESSAGES.NOT_FOUND));
|
|
128
128
|
}
|
package/package.json
CHANGED