Skip to content

Commit 8edf5d9

Browse files
authored
Added disabled option to input element in RolePermissionRow.jsx (#6002)
This will prevent piling of multiple POST request to update role permission api simultaneously. We will disable the button when the api is in loading state
1 parent a2f777f commit 8edf5d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/javascript/components/admin/roles/RolePermissionRow.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default function RolePermissionRow({
3434
className="form-check-input fs-5"
3535
type="checkbox"
3636
defaultChecked={defaultValue}
37+
disabled={updateAPI.isLoading}
3738
onClick={(event) => {
3839
updateAPI.mutate({ role_id: roleId, name: permissionName, value: event.target.checked });
3940
}}

0 commit comments

Comments
 (0)