mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
index and create todos and lists
This commit is contained in:
@@ -3,13 +3,12 @@ const mongoose = require('mongoose');
|
||||
const { Schema } = mongoose;
|
||||
|
||||
const todoSchema = Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
text: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
list: { type: Schema.Types.ObjectId, ref: 'TodoList' },
|
||||
completed: Boolean,
|
||||
list: { type: Schema.Types.ObjectId, ref: 'TodoList', required: true },
|
||||
completed: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
mongoose.model('Todo', todoSchema);
|
||||
|
||||
@@ -3,7 +3,6 @@ const mongoose = require('mongoose');
|
||||
const { Schema } = mongoose;
|
||||
|
||||
const todoListSchema = Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
|
||||
Reference in New Issue
Block a user