🔧 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:
Gabriel Luiz Freitas Almeida 2023-11-07 11:06:28 -03:00
commit e81e1c808d
2 changed files with 10 additions and 1 deletions

View file

@ -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`

View file

@ -9,3 +9,9 @@ export type storeComponent = {
liked_by_count: number;
liked_by_user?: boolean;
};
export type StoreComponentResponse = {
count: number;
authorized: boolean;
results: storeComponent[];
};