diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index f1c3a49a1..8f732215d 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -13,6 +13,7 @@ import { } from "../../types/api/index"; import { UserInputType } from "../../types/components"; import { FlowStyleType, FlowType } from "../../types/flow"; +import { StoreComponentResponse } from "../../types/store"; import { APIClassType, BuildStatusTypeAPI, @@ -621,7 +622,9 @@ export async function getStoreComponents( } } -export async function getStoreSavedComponents() { +export async function getStoreSavedComponents(): Promise< + StoreComponentResponse | undefined +> { try { const res = await api.get( `${BASE_URL_API}store/components/?filter_by_user=true` diff --git a/src/frontend/src/types/store/index.ts b/src/frontend/src/types/store/index.ts index a5e8856f7..8ca9905d1 100644 --- a/src/frontend/src/types/store/index.ts +++ b/src/frontend/src/types/store/index.ts @@ -9,3 +9,9 @@ export type storeComponent = { liked_by_count: number; liked_by_user?: boolean; }; + +export type StoreComponentResponse = { + count: number; + authorized: boolean; + results: storeComponent[]; +};