set up a type for user response from backend

This commit is contained in:
Abi Raja 2024-01-03 16:09:22 -05:00
parent 1f5bec4521
commit 8ff2037579
2 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import FullPageSpinner from "../custom-ui/FullPageSpinner";
import { useAuthenticatedFetch } from "./useAuthenticatedFetch";
import { useStore } from "../../store/store";
import AvatarDropdown from "./AvatarDropdown";
import { UserResponse } from "./types";
function AppContainer() {
const [showPopup, setShowPopup] = useState(false);
@ -34,7 +35,7 @@ function AppContainer() {
isInitRequestInProgress.current = true;
// TODO: Handle when the user is not signed in
const user = await authenticatedFetch(
const user: UserResponse = await authenticatedFetch(
"https://screenshot-to-code-saas.onrender.com/users/create",
// "http://localhost:8001/users/create",
"POST"

View File

@ -0,0 +1,8 @@
// Keep in sync with saas backend
export interface UserResponse {
email: string;
first_name: string;
last_name: string;
subscriber_tier: string;
stripe_customer_id: string;
}