Fixing minor bug with permission add.
This commit is contained in:
parent
cc02397b01
commit
ec5f9788c5
|
@ -71,10 +71,11 @@ async function updatePermissionOnRole(
|
|||
}
|
||||
|
||||
const response = await db.bulkDocs(docUpdates)
|
||||
return response.map(resp => ({
|
||||
...resp,
|
||||
_id: getExternalRoleID(resp._id),
|
||||
}))
|
||||
return response.map(resp => {
|
||||
resp._id = getExternalRoleID(resp.id)
|
||||
delete resp.id
|
||||
return resp
|
||||
})
|
||||
}
|
||||
|
||||
exports.fetchBuiltin = function(ctx) {
|
||||
|
|
|
@ -47,6 +47,7 @@ router.use(async (ctx, next) => {
|
|||
message: err.message,
|
||||
status: ctx.status,
|
||||
}
|
||||
console.trace(err)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("/permission", () => {
|
|||
describe("test", () => {
|
||||
it("should be able to add permission to a role for the table", async () => {
|
||||
expect(perms.length).toEqual(1)
|
||||
expect(perms[0].id).toEqual(`${STD_ROLE_ID}`)
|
||||
expect(perms[0]._id).toEqual(`${STD_ROLE_ID}`)
|
||||
})
|
||||
|
||||
it("should get the resource permissions", async () => {
|
||||
|
|
Loading…
Reference in New Issue