Sindbad~EG File Manager

Current Path : /home/infinitibizsol/.trash/node_modules.8/.cache/esm/
Upload File :
Current File : /home/infinitibizsol/.trash/node_modules.8/.cache/esm/e31ce7c06abf8e6e.js

let db,mongoose;_6ab‍.x([["default",()=>_6ab‍.o]]);_6ab‍.w("../../model/index",[["default",["db"],function(v){db=v}]]);_6ab‍.w("mongoose",[["default",["mongoose"],function(v){mongoose=v}]]);

const User = new (_6ab‍.a("mongoose",mongoose)).Schema(
  {
    first_name: { type: String, required: true },
    last_name: { type: String, required: true },
    contact_type: { type: String, required: false },
    customer_type: { type: String, required: false },
    current_status: { type: String, required: false },
    location: { type: String, required: true },
    profile_picture: { type: String, require: false, default: "" },
    email: { type: String, require: true },
    password: { type: String, require: true },
    email_signature: { type: String, require: false, default: "" },
    role: {
      type: String,
      enum: ["agent", "admin"],
      default: "agent",
    },
    createdOn: { type: Date, default: Date.now },
    modifiedOn: { type: Date, default: Date.now },
  },
  {
    toJSON: { virtuals: true },
    toObject: { virtuals: true },
  }
);

User.index({
  first_name: "text",
  last_name: "text",
  email: "text",
  location: "text",
});

User.pre("remove", async function (next) {
  try {
    console.log("Removing");

    await _6ab‍.a("db",db).Address.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).BasicContactInfo.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).Goal.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).SocialMedia.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).Policy.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).EmailSetup.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).EmployeeInfo.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).EmploymentInfo.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).Signature.deleteMany({ user_id: this._id });
    await _6ab‍.a("db",db).System.deleteMany({ user_id: this._id });
    next();
  } catch (err) {
    next(err);
  }
});

_6ab‍.d(_6ab‍.a("mongoose",mongoose).model("User", User));_6ab‍.j(["default"]);

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists