set up a type for user response from backend
This commit is contained in:
parent
1f5bec4521
commit
8ff2037579
@ -7,6 +7,7 @@ import FullPageSpinner from "../custom-ui/FullPageSpinner";
|
|||||||
import { useAuthenticatedFetch } from "./useAuthenticatedFetch";
|
import { useAuthenticatedFetch } from "./useAuthenticatedFetch";
|
||||||
import { useStore } from "../../store/store";
|
import { useStore } from "../../store/store";
|
||||||
import AvatarDropdown from "./AvatarDropdown";
|
import AvatarDropdown from "./AvatarDropdown";
|
||||||
|
import { UserResponse } from "./types";
|
||||||
|
|
||||||
function AppContainer() {
|
function AppContainer() {
|
||||||
const [showPopup, setShowPopup] = useState(false);
|
const [showPopup, setShowPopup] = useState(false);
|
||||||
@ -34,7 +35,7 @@ function AppContainer() {
|
|||||||
isInitRequestInProgress.current = true;
|
isInitRequestInProgress.current = true;
|
||||||
|
|
||||||
// TODO: Handle when the user is not signed in
|
// 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",
|
"https://screenshot-to-code-saas.onrender.com/users/create",
|
||||||
// "http://localhost:8001/users/create",
|
// "http://localhost:8001/users/create",
|
||||||
"POST"
|
"POST"
|
||||||
|
|||||||
8
frontend/src/components/hosted/types.ts
Normal file
8
frontend/src/components/hosted/types.ts
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user