Skip to content

Update Memory.js#47

Closed
AimWhy wants to merge 1 commit intoseeden:masterfrom
AimWhy:patch-1
Closed

Update Memory.js#47
AimWhy wants to merge 1 commit intoseeden:masterfrom
AimWhy:patch-1

Conversation

@AimWhy
Copy link
Copy Markdown

@AimWhy AimWhy commented Dec 27, 2018

getRoles和getPermissions方法获取数据的方式有问题
this.items 是Object 而不是 Array
需要通过Object.keys(this.items).forEach

getRoles和getPermissions方法获取数据的方式有问题
this.items 是Object 而不是 Array
需要通过Object.keys(this.items).forEach
Copy link
Copy Markdown

@ssipos90 ssipos90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's simpler if you just use Object.values instead of iterating the keys.

Comment thread src/Memory.js
}

async getRoles(): Role[] {
return this.items
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.values(this.items)

Comment thread src/Memory.js
}

async getPermissions(): Permission[] {
return this.items
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.values(this.items)

@seeden seeden deleted the branch seeden:master March 28, 2026 19:44
@seeden seeden closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants