backedn converted to ts
This commit is contained in:
+4
-2
@@ -1,4 +1,5 @@
|
||||
const mongoose = require("mongoose");
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const PostSchema = new Schema({
|
||||
@@ -49,4 +50,5 @@ const PostSchema = new Schema({
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("post", PostSchema);
|
||||
const Post = mongoose.model("post", PostSchema);
|
||||
export default Post
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const ProfileSchema = new mongoose.Schema({
|
||||
user: {
|
||||
@@ -110,4 +110,5 @@ const ProfileSchema = new mongoose.Schema({
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("profile", ProfileSchema);
|
||||
const Profile = mongoose.model("profile", ProfileSchema);
|
||||
export default Profile
|
||||
|
||||
+4
-2
@@ -1,4 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const UserSchema = new mongoose.Schema({
|
||||
name: {
|
||||
@@ -23,4 +23,6 @@ const UserSchema = new mongoose.Schema({
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("user", UserSchema);
|
||||
const User = mongoose.model("user", UserSchema);
|
||||
|
||||
export default User
|
||||
|
||||
Reference in New Issue
Block a user