env context and refactor api support different ports

This commit is contained in:
Milo Schwartz 2024-12-12 22:46:58 -05:00
parent d79760dad9
commit d3d2fe398b
No known key found for this signature in database
35 changed files with 287 additions and 135 deletions

View file

@ -1,6 +1,5 @@
"use client";
import api from "@app/api";
import { Button } from "@app/components/ui/button";
import {
Form,
@ -42,6 +41,8 @@ import {
} from "@app/components/Credenza";
import { useOrgContext } from "@app/hooks/useOrgContext";
import { Description } from "@radix-ui/react-toast";
import { createApiClient } from "@app/api";
import { useEnvContext } from "@app/hooks/useEnvContext";
type InviteUserFormProps = {
open: boolean;
@ -64,6 +65,8 @@ export default function InviteUserForm({
}: InviteUserFormProps) {
const [loading, setLoading] = useState(false);
const api = createApiClient(useEnvContext());
const formSchema = z.object({
string: z.string().refine((val) => val === string, {
message: "Invalid confirmation",