Fix raw permission removal

This commit is contained in:
Jake Barnby 2022-08-12 12:26:58 +12:00
parent a5e6c04cb0
commit 3e17d9398b

View file

@ -39,8 +39,6 @@
if (update) this.rawPermissions.push(`update(${role})`);
if (xdelete) this.rawPermissions.push(`delete(${role})`);
console.log(this.rawPermissions);
this.permissions.push({
role,
read,
@ -53,7 +51,9 @@
},
removePermission(index) {
let row = this.permissions.splice(index, 1);
this.rawPermissions = this.rawPermissions.filter(p => !p.includes(row.role));
if (row.length === 1) {
this.rawPermissions = this.rawPermissions.filter(p => !p.includes(row[0].role));
}
}
}));
Alpine.data('permissionsRow', () => ({