Skip to content

Commit ca4e304

Browse files
Michael MarkietaAwk34
Michael Markieta
authored andcommitted
fix(sql): add a where parameter for model.destroy
This was the error being generated: Error: Missing where or truncate attribute in the options parameter of model.destroy. closes angular-fullstack#1989
1 parent d6447d1 commit ca4e304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: templates/app/server/api/user(auth)/user.controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function show(req, res, next) {
8989
*/
9090
export function destroy(req, res) {
9191
<% if (filters.mongooseModels) { %>return User.findByIdAndRemove(req.params.id).exec()<% }
92-
if (filters.sequelizeModels) { %>return User.destroy({ _id: req.params.id })<% } %>
92+
if (filters.sequelizeModels) { %>return User.destroy({ where: { _id: req.params.id } })<% } %>
9393
.then(function() {
9494
res.status(204).end();
9595
})

0 commit comments

Comments
 (0)