@eeplatform/basic-edu 1.10.24 → 1.10.26

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.10.26
4
+
5
+ ### Patch Changes
6
+
7
+ - 277f223: Update dependencies
8
+
9
+ ## 1.10.25
10
+
11
+ ### Patch Changes
12
+
13
+ - 609e753: Validate school route param in controllers
14
+
3
15
  ## 1.10.24
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -35749,6 +35749,7 @@ function useTrackController() {
35749
35749
  }
35750
35750
  async function getAll(req, res, next) {
35751
35751
  const query = req.query;
35752
+ const school = req.params.school ?? "";
35752
35753
  const validation = import_joi18.default.object({
35753
35754
  page: import_joi18.default.number().min(1).optional().allow("", null),
35754
35755
  limit: import_joi18.default.number().min(1).optional().allow("", null),
@@ -35756,12 +35757,11 @@ function useTrackController() {
35756
35757
  status: import_joi18.default.string().optional().allow("", null),
35757
35758
  school: import_joi18.default.string().hex().optional().allow("", null)
35758
35759
  });
35759
- const { error } = validation.validate(query);
35760
+ const { error } = validation.validate({ ...query, school });
35760
35761
  const page = typeof req.query.page === "string" ? Number(req.query.page) : 1;
35761
35762
  const limit = typeof req.query.limit === "string" ? Number(req.query.limit) : 10;
35762
35763
  const search = req.query.search ?? "";
35763
35764
  const status = req.query.status ?? "active";
35764
- const school = req.query.school ?? "";
35765
35765
  const isPageNumber = isFinite(page);
35766
35766
  if (!isPageNumber) {
35767
35767
  next(new import_nodejs_utils30.BadRequestError("Invalid page number."));
@@ -35914,6 +35914,7 @@ function useStrandController() {
35914
35914
  }
35915
35915
  async function getAll(req, res, next) {
35916
35916
  const query = req.query;
35917
+ const school = req.params.school ?? "";
35917
35918
  const validation = import_joi19.default.object({
35918
35919
  page: import_joi19.default.number().min(1).optional().allow("", null),
35919
35920
  limit: import_joi19.default.number().min(1).optional().allow("", null),
@@ -35922,12 +35923,11 @@ function useStrandController() {
35922
35923
  school: import_joi19.default.string().hex().optional().allow("", null),
35923
35924
  track: import_joi19.default.string().hex().optional().allow("", null)
35924
35925
  });
35925
- const { error } = validation.validate(query);
35926
+ const { error } = validation.validate({ ...query, school });
35926
35927
  const page = typeof req.query.page === "string" ? Number(req.query.page) : 1;
35927
35928
  const limit = typeof req.query.limit === "string" ? Number(req.query.limit) : 10;
35928
35929
  const search = req.query.search ?? "";
35929
35930
  const status = req.query.status ?? "active";
35930
- const school = req.query.school ?? "";
35931
35931
  const track = req.query.track ?? "";
35932
35932
  const isPageNumber = isFinite(page);
35933
35933
  if (!isPageNumber) {