View project, update project Data, Usermodel modified Based on the recentlyViewed

This commit is contained in:
2025-05-15 18:53:18 +05:30
parent 46dafd4417
commit bd0c5013a9
7 changed files with 248 additions and 42 deletions

View File

@@ -4,12 +4,11 @@ export interface User extends Document {
userName: String;
email: String;
password: String;
recentlyViewed: string[];
role: String;
profilePicture: String;
isShare:Boolean,
activeStatus:string
isShare: Boolean;
activeStatus: string;
}
const signupschema: Schema = new Schema({
userName: {
@@ -35,16 +34,19 @@ const signupschema: Schema = new Schema({
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",
},
recentlyViewed: {
type: [String],
default: [],
},
});
// const userModel = (db: string) => {
// const mongoUrl = process.env.MONGO_URI || "";
@@ -63,7 +65,7 @@ const signupschema: Schema = new Schema({
// };
// 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;