reformat with prettier,add react frontend submodule

This commit is contained in:
2018-06-03 12:47:23 +03:00
parent 38688491f9
commit bbee6b2b95
16 changed files with 255 additions and 58 deletions

View File

@@ -15,7 +15,7 @@ const TodoSchema = Schema({
completed: { type: Boolean, default: false },
});
TodoSchema.pre('save', async function () {
TodoSchema.pre('save', async function() {
if (this.isNew) {
const user = await this.model('User').findById(this.user);
user.todos.push(this._id);
@@ -27,7 +27,7 @@ TodoSchema.pre('save', async function () {
}
});
TodoSchema.pre('remove', async function () {
TodoSchema.pre('remove', async function() {
const user = await this.model('User').findById(this.user);
user.todos.splice(user.todos.indexOf(this._id), 1);
await user.save();
@@ -37,7 +37,7 @@ TodoSchema.pre('remove', async function () {
await list.save();
});
TodoSchema.methods.toJson = function () {
TodoSchema.methods.toJson = function() {
return {
id: this._id.toString(),
text: this.text,