Procházet zdrojové kódy

Create the user model.

Lee Morgan před 1 rokem
rodič
revize
f4ea3059c7
2 změnil soubory, kde provedl 28 přidání a 0 odebrání
  1. 28 0
      models/User.js
  2. 0 0
      routes/user.js

+ 28 - 0
models/User.js

@@ -0,0 +1,28 @@
+import mongoose from "mongoose";
+
+const UserSchema = mongoose.Schema({
+    email: {
+        type: String,
+        required: true
+    },
+    password: {
+        type: String,
+        required: true
+    },
+    workouts: [{
+        name: {
+            type: String,
+            required: true
+        },
+        exercises: {
+            type: [String],
+            required: false
+        }
+    }],
+    uuid: {
+        type: String,
+        required: true
+    }
+});
+
+export default mongoose.model("user", UserSchema);

+ 0 - 0
routes/user.js