@eeplatform/basic-edu 1.9.1 → 1.9.2
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.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3140,17 +3140,19 @@ function useEnrollmentRepo() {
|
|
|
3140
3140
|
status = "active",
|
|
3141
3141
|
school = "",
|
|
3142
3142
|
schoolYear = "",
|
|
3143
|
-
|
|
3144
|
-
|
|
3143
|
+
createdBy = "",
|
|
3144
|
+
gradeLevel = ""
|
|
3145
3145
|
} = {}) {
|
|
3146
3146
|
page = page > 0 ? page - 1 : 0;
|
|
3147
3147
|
const query = {
|
|
3148
3148
|
status
|
|
3149
3149
|
};
|
|
3150
3150
|
const cacheParams = {
|
|
3151
|
+
status,
|
|
3151
3152
|
page,
|
|
3152
3153
|
limit,
|
|
3153
|
-
sort: JSON.stringify(sort)
|
|
3154
|
+
sort: JSON.stringify(sort),
|
|
3155
|
+
tag: "getAll"
|
|
3154
3156
|
};
|
|
3155
3157
|
if (createdBy) {
|
|
3156
3158
|
try {
|
|
@@ -3172,30 +3174,11 @@ function useEnrollmentRepo() {
|
|
|
3172
3174
|
query.schoolYear = schoolYear;
|
|
3173
3175
|
cacheParams.schoolYear = schoolYear;
|
|
3174
3176
|
}
|
|
3175
|
-
if (
|
|
3176
|
-
query.
|
|
3177
|
-
cacheParams.
|
|
3177
|
+
if (gradeLevel) {
|
|
3178
|
+
query.gradeLevel = gradeLevel;
|
|
3179
|
+
cacheParams.gradeLevel = gradeLevel;
|
|
3178
3180
|
}
|
|
3179
3181
|
sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
|
|
3180
|
-
if (search) {
|
|
3181
|
-
query.$or = [
|
|
3182
|
-
{ "learnerInfo.firstName": { $regex: search, $options: "i" } },
|
|
3183
|
-
{ "learnerInfo.lastName": { $regex: search, $options: "i" } },
|
|
3184
|
-
{ "learnerInfo.lrn": { $regex: search, $options: "i" } },
|
|
3185
|
-
{ schoolYear: { $regex: search, $options: "i" } },
|
|
3186
|
-
{ gradeLevelToEnroll: { $regex: search, $options: "i" } }
|
|
3187
|
-
];
|
|
3188
|
-
}
|
|
3189
|
-
if (search)
|
|
3190
|
-
cacheParams.search = search;
|
|
3191
|
-
if (status !== "active")
|
|
3192
|
-
cacheParams.status = status;
|
|
3193
|
-
if (school)
|
|
3194
|
-
cacheParams.school = school;
|
|
3195
|
-
if (schoolYear)
|
|
3196
|
-
cacheParams.schoolYear = schoolYear;
|
|
3197
|
-
if (gradeLevelToEnroll)
|
|
3198
|
-
cacheParams.gradeLevelToEnroll = gradeLevelToEnroll;
|
|
3199
3182
|
const cacheKey = makeCacheKey3(namespace_collection, cacheParams);
|
|
3200
3183
|
logger8.log({
|
|
3201
3184
|
level: "info",
|
|
@@ -35245,7 +35228,8 @@ function useEnrollmentController() {
|
|
|
35245
35228
|
school: Joi16.string().hex().optional().allow("", null),
|
|
35246
35229
|
schoolYear: Joi16.string().optional().allow("", null),
|
|
35247
35230
|
gradeLevelToEnroll: Joi16.string().optional().allow("", null),
|
|
35248
|
-
createdBy: Joi16.string().hex().optional().allow("", null)
|
|
35231
|
+
createdBy: Joi16.string().hex().optional().allow("", null),
|
|
35232
|
+
gradeLevel: Joi16.string().optional().allow("", null)
|
|
35249
35233
|
});
|
|
35250
35234
|
const { error } = validation.validate(query);
|
|
35251
35235
|
if (error) {
|
|
@@ -35258,6 +35242,7 @@ function useEnrollmentController() {
|
|
|
35258
35242
|
const sort = req.query.sort ? String(req.query.sort).split(",") : "";
|
|
35259
35243
|
const sortOrder = req.query.sortOrder ? String(req.query.sortOrder).split(",") : "";
|
|
35260
35244
|
const createdBy = req.query.createdBy ?? "";
|
|
35245
|
+
const gradeLevel = req.query.gradeLevel ?? "";
|
|
35261
35246
|
const sortObj = {};
|
|
35262
35247
|
if (sort && sort.length > 0 && sortOrder && sortOrder.length > 0 && sort.length === sortOrder.length) {
|
|
35263
35248
|
for (let i = 0; i < sort.length; i++) {
|
|
@@ -35274,8 +35259,8 @@ function useEnrollmentController() {
|
|
|
35274
35259
|
status: req.query.status,
|
|
35275
35260
|
school: req.query.school,
|
|
35276
35261
|
schoolYear: req.query.schoolYear,
|
|
35277
|
-
|
|
35278
|
-
|
|
35262
|
+
createdBy,
|
|
35263
|
+
gradeLevel
|
|
35279
35264
|
});
|
|
35280
35265
|
res.json(result);
|
|
35281
35266
|
return;
|