autosync_backend2 1.2.78 → 1.2.79

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.d.ts CHANGED
@@ -12643,6 +12643,7 @@ export declare const app: Elysia<"", {
12643
12643
  description: string | null;
12644
12644
  nmKey: string | null;
12645
12645
  };
12646
+ 400: "nmKey давхцаж байна.";
12646
12647
  401: "Токен олдсонгүй";
12647
12648
  422: {
12648
12649
  type: "validation";
@@ -12653,6 +12654,7 @@ export declare const app: Elysia<"", {
12653
12654
  property?: string;
12654
12655
  expected?: string;
12655
12656
  };
12657
+ 500: "Failed to create channel";
12656
12658
  };
12657
12659
  };
12658
12660
  };
package/dist/index.js CHANGED
@@ -288373,8 +288373,15 @@ var NotificationChannelLogic;
288373
288373
  return getPaginationContent(result, query.pagination.size);
288374
288374
  };
288375
288375
  NotificationChannelLogic.create = async (body) => {
288376
- const [result] = await db_default.insert(nmChannelTable).values(body).returning();
288377
- return result;
288376
+ try {
288377
+ const [result] = await db_default.insert(nmChannelTable).values(body).returning();
288378
+ return result;
288379
+ } catch (err2) {
288380
+ if (err2 instanceof DrizzleQueryError && err2.cause instanceof DatabaseError && err2.cause.code === "23505") {
288381
+ return status("Bad Request", "nmKey \u0434\u0430\u0432\u0445\u0446\u0430\u0436 \u0431\u0430\u0439\u043D\u0430.");
288382
+ }
288383
+ return status("Internal Server Error", "Failed to create channel");
288384
+ }
288378
288385
  };
288379
288386
  NotificationChannelLogic.update = async (id, body) => {
288380
288387
  const [result] = await db_default.update(nmChannelTable).set(body).where(eq(nmChannelTable.id, id)).returning();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.2.78",
3
+ "version": "1.2.79",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",