mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-09-12 19:51:00 +05:00
fix: use application document invalidate instead
This commit is contained in:
parent
a5ab5074e3
commit
d9039c822c
@ -71,9 +71,10 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveBitbucketProvider = ({ applicationId }: Props) => {
|
||||
const utils = api.useUtils();
|
||||
const { data: bitbucketProviders } =
|
||||
api.bitbucket.bitbucketProviders.useQuery();
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
|
||||
const { mutateAsync, isPending: isSavingBitbucketProvider } =
|
||||
api.application.saveBitbucketProvider.useMutation();
|
||||
@ -159,7 +160,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Service Provider Saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the Bitbucket provider");
|
||||
|
||||
@ -31,7 +31,8 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveDockerProvider = ({ applicationId }: Props) => {
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const utils = api.useUtils();
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
|
||||
const { mutateAsync } = api.application.saveDockerProvider.useMutation();
|
||||
const form = useForm<DockerProvider>({
|
||||
@ -65,7 +66,7 @@ export const SaveDockerProvider = ({ applicationId }: Props) => {
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Docker Provider Saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the Docker provider");
|
||||
|
||||
@ -23,7 +23,8 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveDragNDrop = ({ applicationId }: Props) => {
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const utils = api.useUtils();
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
|
||||
const { mutateAsync, isPending } =
|
||||
api.application.dropDeployment.useMutation();
|
||||
@ -54,7 +55,7 @@ export const SaveDragNDrop = ({ applicationId }: Props) => {
|
||||
await mutateAsync(formData)
|
||||
.then(async () => {
|
||||
toast.success("Deployment saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the deployment");
|
||||
|
||||
@ -55,7 +55,8 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveGitProvider = ({ applicationId }: Props) => {
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const utils = api.useUtils();
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
const { data: sshKeys } = api.sshKey.allForApps.useQuery();
|
||||
const router = useRouter();
|
||||
|
||||
@ -99,7 +100,7 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Git Provider Saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the Git provider");
|
||||
|
||||
@ -86,8 +86,9 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
||||
const utils = api.useUtils();
|
||||
const { data: giteaProviders } = api.gitea.giteaProviders.useQuery();
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
|
||||
const { mutateAsync, isPending: isSavingGiteaProvider } =
|
||||
api.application.saveGiteaProvider.useMutation();
|
||||
@ -174,7 +175,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Service Provider Saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the Gitea provider");
|
||||
|
||||
@ -69,8 +69,9 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveGithubProvider = ({ applicationId }: Props) => {
|
||||
const utils = api.useUtils();
|
||||
const { data: githubProviders } = api.github.githubProviders.useQuery();
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
|
||||
const { mutateAsync, isPending: isSavingGithubProvider } =
|
||||
api.application.saveGithubProvider.useMutation();
|
||||
@ -150,7 +151,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Service Provider Saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the github provider");
|
||||
|
||||
@ -72,8 +72,9 @@ interface Props {
|
||||
}
|
||||
|
||||
export const SaveGitlabProvider = ({ applicationId }: Props) => {
|
||||
const utils = api.useUtils();
|
||||
const { data: gitlabProviders } = api.gitlab.gitlabProviders.useQuery();
|
||||
const { data, refetch } = api.application.one.useQuery({ applicationId });
|
||||
const { data } = api.application.one.useQuery({ applicationId });
|
||||
|
||||
const { mutateAsync, isPending: isSavingGitlabProvider } =
|
||||
api.application.saveGitlabProvider.useMutation();
|
||||
@ -169,7 +170,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Service Provider Saved");
|
||||
await refetch();
|
||||
await utils.application.one.invalidate({ applicationId });
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error saving the gitlab provider");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user