autosync_backend2 1.2.2 → 1.2.3

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
@@ -3196,7 +3196,7 @@ export declare const app: Elysia<"", {
3196
3196
  query: unknown;
3197
3197
  headers: unknown;
3198
3198
  response: {
3199
- 200: {
3199
+ 200: void | {
3200
3200
  id: string;
3201
3201
  name: string;
3202
3202
  email: string;
@@ -3209,7 +3209,6 @@ export declare const app: Elysia<"", {
3209
3209
  kind: "ADMIN" | "COMPANY_ADMIN" | "CUSTOMER" | "INSPECTION";
3210
3210
  employeeId: string | null;
3211
3211
  };
3212
- 404: "Хэрэглэгч олдсонгүй.";
3213
3212
  422: {
3214
3213
  type: "validation";
3215
3214
  on: string;
package/dist/index.js CHANGED
@@ -148600,8 +148600,7 @@ var accountRoutes = new Elysia({
148600
148600
  auth: true,
148601
148601
  tags: ["CompanyAccount"]
148602
148602
  }).get("/", async ({ query }) => await service.get(query), {
148603
- query: model_default.select,
148604
- userKind: "COMPANY_ADMIN"
148603
+ query: model_default.select
148605
148604
  }).post("/", async ({ body, user: user2 }) => await logic_default.create(body, user2), {
148606
148605
  body: model_default.create,
148607
148606
  userKind: "COMPANY_ADMIN"
@@ -154923,15 +154922,16 @@ var UserLogic;
154923
154922
  return await db_default.transaction(async (db2) => {
154924
154923
  const isAdmin = user2.kind === "ADMIN";
154925
154924
  const [updatedUser] = await db2.update(user).set(body).where(and(eq(user.id, id), eq(user.companyId, user2.companyId).if(!isAdmin), eq(user.branchId, user2.branchId).if(!isAdmin))).returning();
154925
+ if (!updatedUser) {
154926
+ throw status("Not Found", "\u0425\u044D\u0440\u044D\u0433\u043B\u044D\u0433\u0447 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
154927
+ }
154926
154928
  if (body.password) {
154927
- await auth2.api.resetPassword({
154929
+ const data = await auth2.api.resetPassword({
154928
154930
  body: {
154929
154931
  newPassword: body.password
154930
154932
  }
154931
154933
  });
154932
- }
154933
- if (!updatedUser) {
154934
- return status("Not Found", "\u0425\u044D\u0440\u044D\u0433\u043B\u044D\u0433\u0447 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
154934
+ console.log(data);
154935
154935
  }
154936
154936
  return updatedUser;
154937
154937
  });
@@ -154985,7 +154985,7 @@ var userRoutes = new Elysia({
154985
154985
  }).post("/", async ({ body, user: user2 }) => logic_default22.registerUser(body, user2), {
154986
154986
  body: createUserSchema,
154987
154987
  userKind: "COMPANY_ADMIN"
154988
- }).put("/:id", async ({ body, user: user2, params: { id } }) => logic_default22.update(id, body, user2), {
154988
+ }).put("/:id", async ({ body, user: user2, params: { id } }) => logic_default22.update(id, body, user2).catch((e) => console.log(e)), {
154989
154989
  body: updateUserSchema,
154990
154990
  userKind: "COMPANY_ADMIN"
154991
154991
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",