fixes erronous render of add button

This commit is contained in:
Alex Corey
2021-01-08 15:34:56 -05:00
parent e1fb6542c3
commit 186a1b04b4
2 changed files with 2 additions and 3 deletions

View File

@@ -98,8 +98,7 @@ function UserRolesList({ i18n, user }) {
);
const canAdd =
user?.summary_fields?.user_capabilities?.edit ||
(actions && Object.prototype.hasOwnProperty.call(actions, 'POST'));
actions && Object.prototype.hasOwnProperty.call(actions, 'POST');
const detailUrl = role => {
const { resource_id, resource_type } = role.summary_fields;

View File

@@ -12,7 +12,7 @@ jest.mock('../../../api/models/Roles');
UsersAPI.readOptions.mockResolvedValue({
data: {
actions: { GET: {} },
actions: { GET: {}, POST: {} },
related_search_fields: [],
},
});