moahmedwafy commited on
Commit
cefba2c
·
1 Parent(s): a27d3dd

chore: rename userModel to User

Browse files
src/common/models/user.model.ts CHANGED
@@ -100,4 +100,4 @@ userSchema.pre("save", async function (next) {
100
 
101
  export type UserDocument = IUser & mongoose.Document;
102
 
103
- export const userModel = mongoose.model<UserDocument>("userse", userSchema);
 
100
 
101
  export type UserDocument = IUser & mongoose.Document;
102
 
103
+ export const User = mongoose.model<UserDocument>("users", userSchema);
src/modules/console/modules/users/services/users.service.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { userModel } from "@common/models/user.model";
2
  import { CrudService } from "@lib/services/crud.service";
3
 
4
- export class UsersService extends CrudService(userModel) {}
 
1
+ import { User } from "@common/models/user.model";
2
  import { CrudService } from "@lib/services/crud.service";
3
 
4
+ export class UsersService extends CrudService(User) {}
src/modules/users/modules/auth/services/users-auth.service.ts CHANGED
@@ -2,11 +2,11 @@ import bcrypt from "bcrypt";
2
  import { ILogin } from "../validation/login.validation";
3
  import { HttpError } from "@lib/error-handling/http-error";
4
  import { JwtHelper } from "@helpers/jwt.helper";
5
- import { userModel } from "@common/models/user.model";
6
  import { IUserRegister } from "@common/validations/user-register.validation";
7
  import { CrudService } from "@lib/services/crud.service";
8
 
9
- export class UsersAuthService extends CrudService(userModel) {
10
  async register(createParams: IUserRegister) {
11
  return this.create(createParams);
12
  }
 
2
  import { ILogin } from "../validation/login.validation";
3
  import { HttpError } from "@lib/error-handling/http-error";
4
  import { JwtHelper } from "@helpers/jwt.helper";
5
+ import { User } from "@common/models/user.model";
6
  import { IUserRegister } from "@common/validations/user-register.validation";
7
  import { CrudService } from "@lib/services/crud.service";
8
 
9
+ export class UsersAuthService extends CrudService(User) {
10
  async register(createParams: IUserRegister) {
11
  return this.create(createParams);
12
  }
src/modules/users/modules/auth/services/users.service.ts CHANGED
@@ -2,11 +2,11 @@ import bcrypt from "bcrypt";
2
  import { ILogin } from "../validation/login.validation";
3
  import { HttpError } from "@lib/error-handling/http-error";
4
  import { JwtHelper } from "@helpers/jwt.helper";
5
- import { userModel } from "@common/models/user.model";
6
  import { IUserRegister } from "@common/validations/user-register.validation";
7
  import { CrudService } from "@lib/services/crud.service";
8
 
9
- export class UsersAuthService extends CrudService(userModel) {
10
  async register(createParams: IUserRegister) {
11
  return this.create(createParams);
12
  }
 
2
  import { ILogin } from "../validation/login.validation";
3
  import { HttpError } from "@lib/error-handling/http-error";
4
  import { JwtHelper } from "@helpers/jwt.helper";
5
+ import { User } from "@common/models/user.model";
6
  import { IUserRegister } from "@common/validations/user-register.validation";
7
  import { CrudService } from "@lib/services/crud.service";
8
 
9
+ export class UsersAuthService extends CrudService(User) {
10
  async register(createParams: IUserRegister) {
11
  return this.create(createParams);
12
  }