component.ts [在此代码中,我想从特定角色中删除用户... 但不会将其从角色中删除。 API工作正常,但角度不对,因此无法移除... 这有什么问题?如果可以将其找出来,请发送一些解决方案吗?]
removeUsers(master, name) {
console.log(master)
if (master.is_master === true) {
this.payload = {
"companyusers_id":master.company_user_id.id,
"role_id" : master.role_id
}
console.log(this.payload)
}
else {
this.payload ={
"companyusers_id":master.company_user_id.id,
"role_id" : master.role_task_id.role_id,
"task_id" : master.role_task_id.id
}
console.log(this.payload)
}
this.removeUserRoles(this.payload);
}
removeUserRoles(payload){
this.store.dispatch(new RemoveUserRoles(payload))
this.store.pipe(select(getRemoveUserRolesSuccess)).subscribe((result:any)=>{
console.log(result);
alert("User Removed Successfully")
})
this.store.pipe(select(getRemoveUserRolesError)).subscribe((result:any)=>{
if(!!result){
console.log(result)
}
html(在这段代码中,我想从特定角色中删除用户... 但不会将其从角色中删除。 API工作正常,但角度不对,因此无法移除... 这有什么问题?如果可以将其找出来,请发送一些解决方案吗?)
<div class="btn-custom" (click)="removeUsers(master, master?.company_user_id?.user_id?.name)" style="text-align: end;cursor:pointer;">Remove</div>
<div class="btn-custom" (click)="removeUsers(task, task?.company_user_id?.user_id?.name)">Remove</div>