Skip to content

Commit 731b725

Browse files
fix: #287
1 parent 91939a1 commit 731b725

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
Started from version 0.2.5
99

10-
## [0.3.1] - 2020-02-12
10+
## [0.3.1-3] - 2020-02-12
1111

1212
### Fixed
1313

14-
* allow to have not "id" property as a primary key
14+
* allow to have not "id" property as a primary key [#287]
1515

1616
## [0.3.0] - 2019-12-29
1717

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "admin-bro-sequelizejs",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Sequelize adapter for AdminBro",
55
"main": "index.js",
66
"scripts": {

src/resource.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ class Resource extends BaseResource {
145145
}
146146

147147
async delete(id) {
148-
return this.SequelizeModel.destroy({ where: { id } })
148+
return this.SequelizeModel.destroy({
149+
where: {
150+
[this.SequelizeModel.primaryKeyField]: id,
151+
},
152+
})
149153
}
150154

151155
createValidationError(originalError) {

0 commit comments

Comments
 (0)