Skip to content

Commit 7c5746c

Browse files
committed
[BUGFIX] fixes update bug
1 parent 0645ce5 commit 7c5746c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/db/baseModel.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ module.exports = {
153153

154154
// passing an object as the property
155155
return this.forge()
156-
.query({where: property})
156+
.query({ where: property })
157157
.fetch();
158158
},
159159

@@ -171,7 +171,7 @@ module.exports = {
171171
return this
172172
.forge()
173173
.query(function (qb) {
174-
qb.where({id});
174+
qb.where({ id });
175175
qb.delete(['*']);
176176
});
177177
},
@@ -181,11 +181,10 @@ module.exports = {
181181
// .save(record, {patch: true, require: false});
182182

183183
return this
184-
.forge()
185-
.query(function (qb) {
186-
qb.where({id});
187-
qb.update(record, ['*']);
184+
.forge({ id })
185+
.save(record, { patch: true, require: false })
186+
.then(() => {
187+
return this.find(id);
188188
});
189-
190189
},
191190
};

0 commit comments

Comments
 (0)