@eeplatform/basic-edu 1.3.9 → 1.3.10

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/dist/index.mjs CHANGED
@@ -4515,7 +4515,6 @@ function useSchoolRepo() {
4515
4515
  { key: { name: 1 } },
4516
4516
  { key: { createdAt: 1 } },
4517
4517
  { key: { name: "text" } },
4518
- { key: { cityMunicipalityPSGC: 1 }, unique: true, name: "unique_psgc" },
4519
4518
  { key: { id: 1, status: 1 }, unique: true, name: "unique_school_id" }
4520
4519
  ]);
4521
4520
  } catch (error) {
@@ -33298,14 +33297,20 @@ ${errors.slice(0, 5).join("\n")}${errors.length > 5 ? `
33298
33297
  session.startTransaction();
33299
33298
  const school = schools[i];
33300
33299
  try {
33301
- const provincePSGC = await getPSGCByName({
33302
- name: school.province ?? "",
33303
- type: "Prov"
33304
- });
33300
+ let provincePSGC = "";
33301
+ if (school.province) {
33302
+ const provinceData = await getPSGCByName({
33303
+ name: school.province,
33304
+ type: "Prov"
33305
+ });
33306
+ if (provinceData) {
33307
+ provincePSGC = provinceData.code ?? "";
33308
+ }
33309
+ }
33305
33310
  const cityMunPSGC = await getPSGCByName({
33306
33311
  name: school.cityMunicipality ?? "",
33307
33312
  type: "City",
33308
- prefix: provincePSGC ? provincePSGC.code.toString().slice(0, 5) : ""
33313
+ prefix: provincePSGC ? provincePSGC.toString().slice(0, 5) : ""
33309
33314
  });
33310
33315
  if (!cityMunPSGC) {
33311
33316
  throw new BadRequestError18(