mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: remove imports
This commit is contained in:
@@ -20,7 +20,8 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ShowEnvironment = ({ applicationId }: Props) => {
|
export const ShowEnvironment = ({ applicationId }: Props) => {
|
||||||
const saveEnvironmentMutation = api.application.saveEnvironment.useMutation();
|
const { mutateAsync, isLoading } =
|
||||||
|
api.application.saveEnvironment.useMutation();
|
||||||
|
|
||||||
const { data, refetch } = api.application.one.useQuery(
|
const { data, refetch } = api.application.one.useQuery(
|
||||||
{
|
{
|
||||||
@@ -40,12 +41,11 @@ export const ShowEnvironment = ({ applicationId }: Props) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onEnvSubmit = async (data: EnvironmentSchema) => {
|
const onEnvSubmit = async (data: EnvironmentSchema) => {
|
||||||
saveEnvironmentMutation
|
mutateAsync({
|
||||||
.mutateAsync({
|
env: data.env,
|
||||||
env: data.env,
|
buildArgs: data.buildArgs,
|
||||||
buildArgs: data.buildArgs,
|
applicationId,
|
||||||
applicationId,
|
})
|
||||||
})
|
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Environments Added");
|
toast.success("Environments Added");
|
||||||
await refetch();
|
await refetch();
|
||||||
@@ -91,11 +91,7 @@ export const ShowEnvironment = ({ applicationId }: Props) => {
|
|||||||
)}
|
)}
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="flex flex-row justify-end">
|
<div className="flex flex-row justify-end">
|
||||||
<Button
|
<Button isLoading={isLoading} className="w-fit" type="submit">
|
||||||
isLoading={saveEnvironmentMutation.isLoading}
|
|
||||||
className="w-fit"
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user