Skip to content

Commit 36553e5

Browse files
committed
feat: add type ALL query param to getParentPluginList
1 parent 27df864 commit 36553e5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Shared/Components/Plugin/service.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ export const getPluginStoreData = async ({
7070
appId,
7171
offset = 0,
7272
signal,
73-
size = 20,
7473
}: GetPluginStoreDataServiceParamsType): Promise<GetPluginStoreDataReturnType> => {
7574
try {
7675
const payload: GetPluginListPayloadType = {
7776
searchKey,
7877
offset,
7978
appId,
80-
size,
79+
size: 20,
8180
tag: selectedTags,
8281
}
8382
const { result } = await get<PluginDetailDTO>(getUrlWithSearchParams(ROUTES.PLUGIN_GLOBAL_LIST_V2, payload), {
@@ -118,7 +117,7 @@ export const getAvailablePluginTags = async (appId: number): Promise<string[]> =
118117
}
119118
}
120119

121-
export const getParentPluginList = async (appId?: number): Promise<ResponseType<MinParentPluginDTO[]>> => {
122-
const queryParams: GetParentPluginListPayloadType = { appId }
123-
return get<MinParentPluginDTO[]>(getUrlWithSearchParams(ROUTES.PLUGIN_LIST_MIN, queryParams))
124-
}
120+
export const getParentPluginList = async (
121+
params: Partial<GetParentPluginListPayloadType>,
122+
): Promise<ResponseType<MinParentPluginDTO[]>> =>
123+
get<MinParentPluginDTO[]>(getUrlWithSearchParams(ROUTES.PLUGIN_LIST_MIN, params))

src/Shared/Components/Plugin/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export interface PluginAPIBaseQueryParamsType {
3030
}
3131

3232
export interface GetPluginTagsPayloadType extends PluginAPIBaseQueryParamsType {}
33-
export interface GetParentPluginListPayloadType extends PluginAPIBaseQueryParamsType {}
33+
export interface GetParentPluginListPayloadType extends PluginAPIBaseQueryParamsType {
34+
type?: 'ALL'
35+
}
3436

3537
export interface PluginTagNamesDTO {
3638
tagNames: string[]
@@ -73,7 +75,7 @@ export interface ParentPluginDTO {
7375
pluginIdentifier: string
7476
}
7577

76-
export interface MinParentPluginDTO extends Pick<ParentPluginDTO, 'id' | 'name' | 'icon'> {}
78+
export interface MinParentPluginDTO extends Pick<ParentPluginDTO, 'id' | 'name' | 'icon' | 'pluginIdentifier'> {}
7779

7880
export interface PluginDetailDTO {
7981
parentPlugins: ParentPluginDTO[]
@@ -180,7 +182,6 @@ export interface GetPluginStoreDataServiceParamsType extends Pick<PluginListFilt
180182
signal: AbortSignal
181183
appId: number
182184
offset?: number
183-
size?: number
184185
}
185186

186187
export interface GetPluginListPayloadType

0 commit comments

Comments
 (0)