mirror of
https://github.com/typicode/json-server.git
synced 2025-08-02 11:32:47 +08:00
Foreign key suffix (#570)
This commit is contained in:
@ -36,7 +36,16 @@ describe('mixins', () => {
|
||||
{ name: 'comments', id: 3 }
|
||||
]
|
||||
|
||||
assert.deepEqual(_.getRemovable(db), expected)
|
||||
assert.deepEqual(_.getRemovable(db, { foreignKeySuffix: 'Id' }), expected)
|
||||
})
|
||||
|
||||
it('should support custom foreignKeySuffix', () => {
|
||||
const expected = [
|
||||
{ name: 'comments', id: 2 },
|
||||
{ name: 'comments', id: 3 }
|
||||
]
|
||||
|
||||
assert.deepEqual(_.getRemovable(db, { foreignKeySuffix: 'Id' }), expected)
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user