Skip to content

Commit 3160c20

Browse files
Use SequelizeModel.primaryKeyField; fix #13
1 parent 8b1fa6f commit 3160c20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/resource.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ class Resource extends BaseResource {
6262
const ids = baseRecords.map(baseRecord => (
6363
baseRecord.param(property.name())
6464
))
65-
const records = await this.SequelizeModel.findAll({ where: { id: ids } })
65+
const records = await this.SequelizeModel.findAll({
66+
where: { [this.SequelizeModel.primaryKeyField]: ids },
67+
})
6668
const recordsHash = records.reduce((memo, record) => {
6769
memo[record.id] = record
6870
return memo

0 commit comments

Comments
 (0)