@eeplatform/basic-edu 1.10.18 → 1.10.20
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 +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eeplatform/basic-edu
|
|
2
2
|
|
|
3
|
+
## 1.10.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 149fe29: Add getById handler to school controller
|
|
8
|
+
|
|
9
|
+
## 1.10.19
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 635fe76: Update grade level validation schema
|
|
14
|
+
|
|
3
15
|
## 1.10.18
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -698,6 +698,7 @@ declare function useSchoolController(): {
|
|
|
698
698
|
updateFieldById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
699
699
|
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
700
700
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
701
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
701
702
|
};
|
|
702
703
|
|
|
703
704
|
type TAsset = {
|
package/dist/index.js
CHANGED
|
@@ -34650,7 +34650,8 @@ function useSchoolController() {
|
|
|
34650
34650
|
updateStatusById: _updateStatusById,
|
|
34651
34651
|
updateFieldById: _updateFieldById,
|
|
34652
34652
|
updateById: _updateById,
|
|
34653
|
-
deleteById: _deleteById
|
|
34653
|
+
deleteById: _deleteById,
|
|
34654
|
+
getById: _getById
|
|
34654
34655
|
} = useSchoolRepo();
|
|
34655
34656
|
const {
|
|
34656
34657
|
add: _addSchool,
|
|
@@ -34891,6 +34892,22 @@ function useSchoolController() {
|
|
|
34891
34892
|
next(error2);
|
|
34892
34893
|
}
|
|
34893
34894
|
}
|
|
34895
|
+
async function getById(req, res, next) {
|
|
34896
|
+
const schoolId = req.params.id;
|
|
34897
|
+
const validation = import_joi15.default.string().hex().required();
|
|
34898
|
+
const { error } = validation.validate(schoolId);
|
|
34899
|
+
if (error) {
|
|
34900
|
+
next(new import_nodejs_utils24.BadRequestError(`Validation error: ${error.message}`));
|
|
34901
|
+
return;
|
|
34902
|
+
}
|
|
34903
|
+
try {
|
|
34904
|
+
const school = await _getById(schoolId);
|
|
34905
|
+
res.status(200).json(school);
|
|
34906
|
+
return;
|
|
34907
|
+
} catch (error2) {
|
|
34908
|
+
next(error2);
|
|
34909
|
+
}
|
|
34910
|
+
}
|
|
34894
34911
|
return {
|
|
34895
34912
|
add,
|
|
34896
34913
|
getAll,
|
|
@@ -34901,7 +34918,8 @@ function useSchoolController() {
|
|
|
34901
34918
|
addBulk,
|
|
34902
34919
|
updateFieldById,
|
|
34903
34920
|
updateById,
|
|
34904
|
-
deleteById
|
|
34921
|
+
deleteById,
|
|
34922
|
+
getById
|
|
34905
34923
|
};
|
|
34906
34924
|
}
|
|
34907
34925
|
|
|
@@ -37355,10 +37373,11 @@ function useGradeLevelController() {
|
|
|
37355
37373
|
const validation = import_joi23.default.object({
|
|
37356
37374
|
id: import_joi23.default.string().hex().required(),
|
|
37357
37375
|
value: import_joi23.default.object({
|
|
37358
|
-
school: import_joi23.default.string().hex().optional(),
|
|
37359
37376
|
educationLevel: import_joi23.default.string().optional(),
|
|
37360
37377
|
gradeLevel: import_joi23.default.string().optional(),
|
|
37361
37378
|
teachingStyle: import_joi23.default.string().optional(),
|
|
37379
|
+
maxNumberOfLearners: import_joi23.default.number().min(1).optional(),
|
|
37380
|
+
minNumberOfLearners: import_joi23.default.number().min(1).optional(),
|
|
37362
37381
|
maxTeachingHoursPerDay: import_joi23.default.number().integer().min(0).optional(),
|
|
37363
37382
|
maxTeachingHoursPerWeek: import_joi23.default.number().integer().min(0).optional(),
|
|
37364
37383
|
defaultStartTime: import_joi23.default.string().optional().allow("", null),
|