fix(typo): enviroment -> environment

This commit is contained in:
Jesse Holden
2024-05-01 18:40:18 -04:00
parent 307ae22117
commit 5657c45faf
24 changed files with 149 additions and 149 deletions

View File

@@ -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 {
postgresId: string;
}
export const ShowPostgresEnviroment = ({ postgresId }: Props) => {
const { mutateAsync, isLoading } = api.postgres.saveEnviroment.useMutation();
export const ShowPostgresEnvironment = ({ postgresId }: Props) => {
const { mutateAsync, isLoading } = api.postgres.saveEnvironment.useMutation();
const { data, refetch } = api.postgres.one.useQuery(
{
@@ -42,32 +42,32 @@ export const ShowPostgresEnviroment = ({ postgresId }: Props) => {
enabled: !!postgresId,
},
);
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,
postgresId,
})
.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");
});
};
@@ -75,9 +75,9 @@ export const ShowPostgresEnviroment = ({ postgresId }: Props) => {
<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>
@@ -89,7 +89,7 @@ export const ShowPostgresEnviroment = ({ postgresId }: Props) => {
>
<FormField
control={form.control}
name="enviroment"
name="environment"
render={({ field }) => (
<FormItem className="w-full">
<FormControl>