@eeplatform/basic-edu 1.10.19 → 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 +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -34602,7 +34602,8 @@ function useSchoolController() {
|
|
|
34602
34602
|
updateStatusById: _updateStatusById,
|
|
34603
34603
|
updateFieldById: _updateFieldById,
|
|
34604
34604
|
updateById: _updateById,
|
|
34605
|
-
deleteById: _deleteById
|
|
34605
|
+
deleteById: _deleteById,
|
|
34606
|
+
getById: _getById
|
|
34606
34607
|
} = useSchoolRepo();
|
|
34607
34608
|
const {
|
|
34608
34609
|
add: _addSchool,
|
|
@@ -34843,6 +34844,22 @@ function useSchoolController() {
|
|
|
34843
34844
|
next(error2);
|
|
34844
34845
|
}
|
|
34845
34846
|
}
|
|
34847
|
+
async function getById(req, res, next) {
|
|
34848
|
+
const schoolId = req.params.id;
|
|
34849
|
+
const validation = Joi15.string().hex().required();
|
|
34850
|
+
const { error } = validation.validate(schoolId);
|
|
34851
|
+
if (error) {
|
|
34852
|
+
next(new BadRequestError23(`Validation error: ${error.message}`));
|
|
34853
|
+
return;
|
|
34854
|
+
}
|
|
34855
|
+
try {
|
|
34856
|
+
const school = await _getById(schoolId);
|
|
34857
|
+
res.status(200).json(school);
|
|
34858
|
+
return;
|
|
34859
|
+
} catch (error2) {
|
|
34860
|
+
next(error2);
|
|
34861
|
+
}
|
|
34862
|
+
}
|
|
34846
34863
|
return {
|
|
34847
34864
|
add,
|
|
34848
34865
|
getAll,
|
|
@@ -34853,7 +34870,8 @@ function useSchoolController() {
|
|
|
34853
34870
|
addBulk,
|
|
34854
34871
|
updateFieldById,
|
|
34855
34872
|
updateById,
|
|
34856
|
-
deleteById
|
|
34873
|
+
deleteById,
|
|
34874
|
+
getById
|
|
34857
34875
|
};
|
|
34858
34876
|
}
|
|
34859
34877
|
|