mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-17 01:15:19 +00:00
feat(git-provider): improve sharing toggle and authorization checks
- Added loading state for the sharing toggle in the UI to prevent user interaction during processing. - Enhanced authorization logic in the API to ensure that both user and organization ownership are validated before allowing sharing of Git providers. - Improved error handling in the license key deactivation process to log failures for better debugging.
This commit is contained in:
@@ -47,7 +47,7 @@ export const ShowGitProviders = () => {
|
||||
const { data, isPending, refetch } = api.gitProvider.getAll.useQuery();
|
||||
const { mutateAsync, isPending: isRemoving } =
|
||||
api.gitProvider.remove.useMutation();
|
||||
const { mutateAsync: toggleShare } =
|
||||
const { mutateAsync: toggleShare, isPending: isToggling } =
|
||||
api.gitProvider.toggleShare.useMutation();
|
||||
const url = useUrl();
|
||||
|
||||
@@ -184,6 +184,7 @@ export const ShowGitProviders = () => {
|
||||
<div className="flex items-center gap-1.5 mr-2">
|
||||
<Users className="size-4 text-muted-foreground" />
|
||||
<Switch
|
||||
disabled={isToggling}
|
||||
checked={
|
||||
gitProvider.sharedWithOrganization
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user