🔧 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";
|
} from "../../types/api/index";
|
||||||
import { UserInputType } from "../../types/components";
|
import { UserInputType } from "../../types/components";
|
||||||
import { FlowStyleType, FlowType } from "../../types/flow";
|
import { FlowStyleType, FlowType } from "../../types/flow";
|
||||||
|
import { StoreComponentResponse } from "../../types/store";
|
||||||
import {
|
import {
|
||||||
APIClassType,
|
APIClassType,
|
||||||
BuildStatusTypeAPI,
|
BuildStatusTypeAPI,
|
||||||
|
|
@ -621,7 +622,9 @@ export async function getStoreComponents(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getStoreSavedComponents() {
|
export async function getStoreSavedComponents(): Promise<
|
||||||
|
StoreComponentResponse | undefined
|
||||||
|
> {
|
||||||
try {
|
try {
|
||||||
const res = await api.get(
|
const res = await api.get(
|
||||||
`${BASE_URL_API}store/components/?filter_by_user=true`
|
`${BASE_URL_API}store/components/?filter_by_user=true`
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,9 @@ export type storeComponent = {
|
||||||
liked_by_count: number;
|
liked_by_count: number;
|
||||||
liked_by_user?: boolean;
|
liked_by_user?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type StoreComponentResponse = {
|
||||||
|
count: number;
|
||||||
|
authorized: boolean;
|
||||||
|
results: storeComponent[];
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue