Refactor components to enhance code clarity and maintainability by updating prop types to use Readonly for better immutability. Adjust Result class methods for consistency, and streamline query functions in ChannelDetail and other components to improve performance and readability.
This commit is contained in:
@@ -64,7 +64,7 @@ export function UsersPanel() {
|
||||
const unblockMutation = useMutation({ mutationFn: unblockUser, onSuccess: invalidate, onError })
|
||||
const deleteMutation = useMutation({ mutationFn: deleteUser, onSuccess: invalidate, onError })
|
||||
const changeRoleMutation = useMutation({
|
||||
mutationFn: ({ userId, roleId: nextRoleId }: { userId: string; roleId: string }) =>
|
||||
mutationFn: ({ userId, roleId: nextRoleId }: Readonly<{ userId: string; roleId: string }>) =>
|
||||
changeUserRole(userId, nextRoleId),
|
||||
onSuccess: invalidate,
|
||||
onError,
|
||||
@@ -302,11 +302,11 @@ function ResetPasswordDialog({
|
||||
user,
|
||||
onClose,
|
||||
onError,
|
||||
}: {
|
||||
}: Readonly<{
|
||||
user: UserSummaryDto
|
||||
onClose: () => void
|
||||
onError: (e: unknown) => void
|
||||
}) {
|
||||
}>) {
|
||||
const { t } = useTranslation()
|
||||
const [password, setPassword] = useState('')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user