@riocrypto/common 1.0.385 → 1.0.386

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.
@@ -13,10 +13,7 @@ exports.buildAdminAuth = void 0;
13
13
  const password_1 = require("../services/password");
14
14
  const buildAdminAuth = (mongoose) => {
15
15
  // if model is already defined, return it
16
- console.log("buildAdminAuth");
17
- console.log(mongoose.models);
18
16
  if (mongoose.models.AdminAuth) {
19
- console.log("AdminAuth model already defined");
20
17
  return mongoose.model("Admin");
21
18
  }
22
19
  const AdminSchema = new mongoose.Schema({
@@ -56,7 +53,7 @@ const buildAdminAuth = (mongoose) => {
56
53
  AdminSchema.statics.build = (attrs) => {
57
54
  return new AdminAuth(attrs);
58
55
  };
59
- const AdminAuth = mongoose.model("Admin", AdminSchema);
56
+ const AdminAuth = mongoose.model("AdminAuth", AdminSchema);
60
57
  return AdminAuth;
61
58
  };
62
59
  exports.buildAdminAuth = buildAdminAuth;
@@ -14,7 +14,7 @@ const password_1 = require("../services/password");
14
14
  const buildAuth = (mongoose) => {
15
15
  // if model is already defined, return it
16
16
  if (mongoose.models.Auth) {
17
- return mongoose.models.Auth;
17
+ return mongoose.model("Auth");
18
18
  }
19
19
  const AuthSchema = new mongoose.Schema({
20
20
  phoneNumber: {
@@ -4,7 +4,7 @@ exports.buildBankPayout = void 0;
4
4
  const buildBankPayout = (mongoose) => {
5
5
  // if model is already defined, return it
6
6
  if (mongoose.models.BankPayout) {
7
- return mongoose.models.BankPayout;
7
+ return mongoose.model("BankPayout");
8
8
  }
9
9
  const BankPayoutSchema = new mongoose.Schema({
10
10
  orderId: {
@@ -4,7 +4,7 @@ exports.buildBusinessUser = void 0;
4
4
  const buildBusinessUser = (mongoose) => {
5
5
  // if model is already defined, return it
6
6
  if (mongoose.models.BusinessUser) {
7
- return mongoose.models.BusinessUser;
7
+ return mongoose.model("BusinessUser");
8
8
  }
9
9
  const BusinessUserSchema = new mongoose.Schema({
10
10
  type: {
@@ -4,7 +4,7 @@ exports.buildOrder = void 0;
4
4
  const buildOrder = (mongoose) => {
5
5
  // if model is already defined, return it
6
6
  if (mongoose.models.Order) {
7
- return mongoose.models.Order;
7
+ return mongoose.model("Order");
8
8
  }
9
9
  const orderSchema = new mongoose.Schema({
10
10
  userId: {
@@ -4,7 +4,7 @@ exports.buildPartner = void 0;
4
4
  const buildPartner = (mongoose) => {
5
5
  // if model is already defined, return it
6
6
  if (mongoose.models.Partner) {
7
- return mongoose.models.Partner;
7
+ return mongoose.model("Partner");
8
8
  }
9
9
  const PartnerSchema = new mongoose.Schema({
10
10
  name: {
@@ -4,7 +4,7 @@ exports.buildUser = void 0;
4
4
  const buildUser = (mongoose) => {
5
5
  // if model is already defined, return it
6
6
  if (mongoose.models.User) {
7
- return mongoose.models.User;
7
+ return mongoose.model("User");
8
8
  }
9
9
  const userSchema = new mongoose.Schema({
10
10
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.385",
3
+ "version": "1.0.386",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",