Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typo): enviroment -> environment #20

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ import { api } from "@/utils/api";
import { toast } from "sonner";
import { Textarea } from "@/components/ui/textarea";

const addEnviromentSchema = z.object({
enviroment: z.string(),
const addEnvironmentSchema = z.object({
environment: z.string(),
});

type EnviromentSchema = z.infer<typeof addEnviromentSchema>;
type EnvironmentSchema = z.infer<typeof addEnvironmentSchema>;

interface Props {
applicationId: string;
}

export const ShowEnviroment = ({ applicationId }: Props) => {
export const ShowEnvironment = ({ applicationId }: Props) => {
const { mutateAsync, isLoading } =
api.application.saveEnviroment.useMutation();
api.application.saveEnvironment.useMutation();

const { data, refetch } = api.application.one.useQuery(
{
Expand All @@ -43,42 +43,42 @@ export const ShowEnviroment = ({ applicationId }: Props) => {
enabled: !!applicationId,
},
);
const form = useForm<EnviromentSchema>({
const form = useForm<EnvironmentSchema>({
defaultValues: {
enviroment: "",
environment: "",
},
resolver: zodResolver(addEnviromentSchema),
resolver: zodResolver(addEnvironmentSchema),
});

useEffect(() => {
if (data) {
form.reset({
enviroment: data.env || "",
environment: data.env || "",
});
}
}, [form.reset, data, form]);

const onSubmit = async (data: EnviromentSchema) => {
const onSubmit = async (data: EnvironmentSchema) => {
mutateAsync({
env: data.enviroment,
env: data.environment,
applicationId,
})
.then(async () => {
toast.success("Enviroments Added");
toast.success("Environments Added");
await refetch();
})
.catch(() => {
toast.error("Error to add enviroment");
toast.error("Error to add environment");
});
};

return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Enviroment Settings</CardTitle>
<CardTitle className="text-xl">Environment Settings</CardTitle>
<CardDescription>
You can add enviroment variables to your resource.
You can add environment variables to your resource.
</CardDescription>
</CardHeader>
<CardContent>
Expand All @@ -90,7 +90,7 @@ export const ShowEnviroment = ({ applicationId }: Props) => {
>
<FormField
control={form.control}
name="enviroment"
name="environment"
render={({ field }) => (
<FormItem className="w-full">
<FormControl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import { api } from "@/utils/api";
import { toast } from "sonner";
import { Textarea } from "@/components/ui/textarea";

const addEnviromentSchema = z.object({
enviroment: z.string(),
const addEnvironmentSchema = z.object({
environment: z.string(),
});

type EnviromentSchema = z.infer<typeof addEnviromentSchema>;
type EnvironmentSchema = z.infer<typeof addEnvironmentSchema>;

interface Props {
mariadbId: string;
}

export const ShowMariadbEnviroment = ({ mariadbId }: Props) => {
const { mutateAsync, isLoading } = api.mariadb.saveEnviroment.useMutation();
export const ShowMariadbEnvironment = ({ mariadbId }: Props) => {
const { mutateAsync, isLoading } = api.mariadb.saveEnvironment.useMutation();

const { data, refetch } = api.mariadb.one.useQuery(
{
Expand All @@ -42,42 +42,42 @@ export const ShowMariadbEnviroment = ({ mariadbId }: Props) => {
enabled: !!mariadbId,
},
);
const form = useForm<EnviromentSchema>({
const form = useForm<EnvironmentSchema>({
defaultValues: {
enviroment: "",
environment: "",
},
resolver: zodResolver(addEnviromentSchema),
resolver: zodResolver(addEnvironmentSchema),
});

useEffect(() => {
if (data) {
form.reset({
enviroment: data.env || "",
environment: data.env || "",
});
}
}, [form.reset, data, form]);

const onSubmit = async (data: EnviromentSchema) => {
const onSubmit = async (data: EnvironmentSchema) => {
mutateAsync({
env: data.enviroment,
env: data.environment,
mariadbId,
})
.then(async () => {
toast.success("Enviroments Added");
toast.success("Environments Added");
await refetch();
})
.catch(() => {
toast.error("Error to add enviroment");
toast.error("Error to add environment");
});
};

return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Enviroment Settings</CardTitle>
<CardTitle className="text-xl">Environment Settings</CardTitle>
<CardDescription>
You can add enviroment variables to your database.
You can add environment variables to your database.
</CardDescription>
</CardHeader>
<CardContent>
Expand All @@ -89,7 +89,7 @@ export const ShowMariadbEnviroment = ({ mariadbId }: Props) => {
>
<FormField
control={form.control}
name="enviroment"
name="environment"
render={({ field }) => (
<FormItem className="w-full">
<FormControl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";

const addEnviromentSchema = z.object({
enviroment: z.string(),
const addEnvironmentSchema = z.object({
environment: z.string(),
});

type EnviromentSchema = z.infer<typeof addEnviromentSchema>;
type EnvironmentSchema = z.infer<typeof addEnvironmentSchema>;

interface Props {
mongoId: string;
}

export const ShowMongoEnviroment = ({ mongoId }: Props) => {
const { mutateAsync, isLoading } = api.mongo.saveEnviroment.useMutation();
export const ShowMongoEnvironment = ({ mongoId }: Props) => {
const { mutateAsync, isLoading } = api.mongo.saveEnvironment.useMutation();

const { data, refetch } = api.mongo.one.useQuery(
{
Expand All @@ -42,42 +42,42 @@ export const ShowMongoEnviroment = ({ mongoId }: Props) => {
enabled: !!mongoId,
},
);
const form = useForm<EnviromentSchema>({
const form = useForm<EnvironmentSchema>({
defaultValues: {
enviroment: "",
environment: "",
},
resolver: zodResolver(addEnviromentSchema),
resolver: zodResolver(addEnvironmentSchema),
});

useEffect(() => {
if (data) {
form.reset({
enviroment: data.env || "",
environment: data.env || "",
});
}
}, [form.reset, data, form]);

const onSubmit = async (data: EnviromentSchema) => {
const onSubmit = async (data: EnvironmentSchema) => {
mutateAsync({
env: data.enviroment,
env: data.environment,
mongoId,
})
.then(async () => {
toast.success("Enviroments Added");
toast.success("Environments Added");
await refetch();
})
.catch(() => {
toast.error("Error to add enviroment");
toast.error("Error to add environment");
});
};

return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Enviroment Settings</CardTitle>
<CardTitle className="text-xl">Environment Settings</CardTitle>
<CardDescription>
You can add enviroment variables to your database.
You can add environment variables to your database.
</CardDescription>
</CardHeader>
<CardContent>
Expand All @@ -89,7 +89,7 @@ export const ShowMongoEnviroment = ({ mongoId }: Props) => {
>
<FormField
control={form.control}
name="enviroment"
name="environment"
render={({ field }) => (
<FormItem className="w-full">
<FormControl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import { api } from "@/utils/api";
import { toast } from "sonner";
import { Textarea } from "@/components/ui/textarea";

const addEnviromentSchema = z.object({
enviroment: z.string(),
const addEnvironmentSchema = z.object({
environment: z.string(),
});

type EnviromentSchema = z.infer<typeof addEnviromentSchema>;
type EnvironmentSchema = z.infer<typeof addEnvironmentSchema>;

interface Props {
mysqlId: string;
}

export const ShowMysqlEnviroment = ({ mysqlId }: Props) => {
const { mutateAsync, isLoading } = api.mysql.saveEnviroment.useMutation();
export const ShowMysqlEnvironment = ({ mysqlId }: Props) => {
const { mutateAsync, isLoading } = api.mysql.saveEnvironment.useMutation();

const { data, refetch } = api.mysql.one.useQuery(
{
Expand All @@ -42,42 +42,42 @@ export const ShowMysqlEnviroment = ({ mysqlId }: Props) => {
enabled: !!mysqlId,
},
);
const form = useForm<EnviromentSchema>({
const form = useForm<EnvironmentSchema>({
defaultValues: {
enviroment: "",
environment: "",
},
resolver: zodResolver(addEnviromentSchema),
resolver: zodResolver(addEnvironmentSchema),
});

useEffect(() => {
if (data) {
form.reset({
enviroment: data.env || "",
environment: data.env || "",
});
}
}, [form.reset, data, form]);

const onSubmit = async (data: EnviromentSchema) => {
const onSubmit = async (data: EnvironmentSchema) => {
mutateAsync({
env: data.enviroment,
env: data.environment,
mysqlId,
})
.then(async () => {
toast.success("Enviroments Added");
toast.success("Environments Added");
await refetch();
})
.catch(() => {
toast.error("Error to add enviroment");
toast.error("Error to add environment");
});
};

return (
<div className="flex w-full flex-col gap-5 ">
<Card className="bg-background">
<CardHeader>
<CardTitle className="text-xl">Enviroment Settings</CardTitle>
<CardTitle className="text-xl">Environment Settings</CardTitle>
<CardDescription>
You can add enviroment variables to your database.
You can add environment variables to your database.
</CardDescription>
</CardHeader>
<CardContent>
Expand All @@ -89,7 +89,7 @@ export const ShowMysqlEnviroment = ({ mysqlId }: Props) => {
>
<FormField
control={form.control}
name="enviroment"
name="environment"
render={({ field }) => (
<FormItem className="w-full">
<FormControl>
Expand Down
Loading
Loading