From 097a9adcf3e45243363e87705f81680c2e2b344e Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Sat, 12 Mar 2016 09:58:05 +0330 Subject: [PATCH] fix(one-to-many): raw parameters are removed --- package.json | 2 +- src/associations/one-to-many.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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);