Testing failer uncomment issue sorted API-Docker updated based on the Failed testcase

This commit is contained in:
2025-05-28 09:42:00 +05:30
parent f2cad42d30
commit 41e2075c55
90 changed files with 2485 additions and 4308 deletions

View File

@@ -1,4 +1,4 @@
import mongoose, { Document, Schema } from "mongoose";
import { Document, Schema } from "mongoose";
import MainModel from "../connect/mongoose.ts";
export interface User extends Document {
userName: String;
@@ -7,9 +7,8 @@ export interface User extends Document {
role: String;
profilePicture: String;
isShare:Boolean,
activeStatus:string
isShare: Boolean;
activeStatus: string;
}
const signupschema: Schema = new Schema({
userName: {
@@ -33,37 +32,19 @@ const signupschema: Schema = new Schema({
},
profilePicture: {
type: String,
// default: "default-profile-picture.jpg"
},
isShare:{
type:Boolean,
default:false
},
activeStatus:{
type:String,
isShare: {
type: Boolean,
default: false,
},
activeStatus: {
type: String,
enum: ["online", "offline"],
default: "offline"
}
default: "offline",
},
});
// const userModel = (db: string) => {
// const mongoUrl = process.env.MONGO_URI || "";
// if (!mongoUrl) {
// throw new Error("MONGO_URI environment variable is not set");
// }
// // Connect to the database
// const dbConnection = mongoose.createConnection(mongoUrl, {
// dbName: db, // Specify the database name here
// serverSelectionTimeoutMS: 30000,
// });
// // Return the model
// return dbConnection.model("Users", signupschema, "Users");
// };
// export default userModel;
const userModel = (db:string) => {
return MainModel(db, "Users", signupschema, "Users")
const userModel = (db: string) => {
return MainModel(db, "Users", signupschema, "Users");
};
export default userModel;
export default userModel;