rename owner to ownerEntity for getQueryParams

Signed-off-by: Prasetya Aria Wibawa <prasetya.wibawa@grabtaxi.com>
This commit is contained in:
Prasetya Aria Wibawa
2022-03-04 15:13:45 +07:00
parent 80b47162be
commit e4d5b8c7ff
@@ -35,10 +35,10 @@ type EntityTypeProps = {
};
const getQueryParams = (
owner: Entity,
ownerEntity: Entity,
selectedEntity: EntityTypeProps,
): string => {
const ownerName = humanizeEntityRef(owner, { defaultKind: 'group' });
const ownerName = humanizeEntityRef(ownerEntity, { defaultKind: 'group' });
const { kind, type } = selectedEntity;
const filters = {
kind,
@@ -46,8 +46,8 @@ const getQueryParams = (
owners: [ownerName],
user: 'all',
};
if (owner.kind === 'User') {
const ownerGroups = getEntityRelations(owner, RELATION_MEMBER_OF, {
if (ownerEntity.kind === 'User') {
const ownerGroups = getEntityRelations(ownerEntity, RELATION_MEMBER_OF, {
kind: 'Group',
});
const ownerGroupsName = ownerGroups.map(ownerGroup => ownerGroup.name);