diff --git a/package.json b/package.json index 48962a7..81935f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hapi-sequelize-crud", - "version": "2.0.0", + "version": "2.0.1", "description": "Hapi plugin that automatically generates RESTful API for CRUD", "main": "build/index.js", "config": { diff --git a/src/associations/one-to-many.js b/src/associations/one-to-many.js index 22eda4a..36798d8 100644 --- a/src/associations/one-to-many.js +++ b/src/associations/one-to-many.js @@ -152,7 +152,9 @@ export const destroy = (server, a, b, names) => { const where = parseWhere(request); const base = await a.findOne({ - where: request.params.aid + where: { + id: request.params.aid + } }); const method = getMethod(base, names.b);