Skip to content

Commit

Permalink
fix: prevent error when enpty data from backend
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <vitor@php.rio>
  • Loading branch information
vitormattos committed Jan 28, 2025
1 parent 35f9608 commit 1b080db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/Settings/AllowedGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
idKey: 0,
}),

async mounted() {
async created() {
await this.searchGroup('')
await this.getData()
},
Expand All @@ -64,6 +64,9 @@ export default {
)
.then(({ data }) => {
const groupsSelected = JSON.parse(data.ocs.data.data)
if (!groupsSelected) {
return
}
this.groupsSelected = this.groups.filter(group => {
return groupsSelected.indexOf(group.id) !== -1
})
Expand Down

0 comments on commit 1b080db

Please sign in to comment.