🔧 fix(API/index.ts): import missing StoreComponentResponse type to fix compilation error
🔧 fix(API/index.ts): add return type annotation to getStoreSavedComponents function for better type safety and clarity
This commit is contained in:
parent
5a5b95afa5
commit
e81e1c808d
2 changed files with 10 additions and 1 deletions
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -9,3 +9,9 @@ export type storeComponent = {
|
|||
liked_by_count: number;
|
||||
liked_by_user?: boolean;
|
||||
};
|
||||
|
||||
export type StoreComponentResponse = {
|
||||
count: number;
|
||||
authorized: boolean;
|
||||
results: storeComponent[];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue