Skip to content

Commit bb082fe

Browse files
committed
refactor: Update route for plugin list versions to 'plugin/global/list/v2/min'
1 parent 4a8e4d4 commit bb082fe

File tree

3 files changed

+5
-37
lines changed

3 files changed

+5
-37
lines changed

src/Common/Constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const ROUTES = {
9898
PLUGIN_GLOBAL_LIST_DETAIL_V2: 'plugin/global/list/detail/v2',
9999
PLUGIN_GLOBAL_LIST_V2: 'plugin/global/list/v2',
100100
PLUGIN_GLOBAL_LIST_TAGS: 'plugin/global/list/tags',
101-
PLUGIN_LIST_MIN: 'plugin/global/list/min',
101+
PLUGIN_LIST_MIN: 'plugin/global/list/v2/min',
102102
}
103103

104104
export enum KEY_VALUE {

src/Shared/Components/Plugin/service.tsx

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,33 +96,5 @@ export const getAvailablePluginTags = async (appId: number): Promise<string[]> =
9696
}
9797
}
9898

99-
// TODO: Remove this mock data and implement the actual API call
100-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
101-
export const getParentPluginList = async (appId?: number): Promise<ResponseType<MinParentPluginDTO[]>> => {
102-
// get<MinParentPluginDTO[]>(getUrlWithSearchParams(ROUTES.PLUGIN_LIST_MIN, { appId }))
103-
// eslint-disable-next-line no-promise-executor-return
104-
await new Promise((resolve) => setTimeout(resolve, 1000))
105-
const mockData: MinParentPluginDTO[] = [
106-
{
107-
id: 1,
108-
pluginName: 'Mock Plugin 1',
109-
icon: 'https://via.placeholder.com/150',
110-
},
111-
{
112-
id: 2,
113-
pluginName: 'Mock Plugin 2',
114-
icon: 'https://via.placeholder.com/150',
115-
},
116-
{
117-
id: 3,
118-
pluginName: 'Mock Plugin 3',
119-
icon: 'https://via.placeholder.com/150',
120-
},
121-
{
122-
id: 4,
123-
pluginName: 'Mock Plugin 4',
124-
icon: 'https://via.placeholder.com/150',
125-
},
126-
]
127-
return Promise.resolve({ result: mockData, status: 'OK', code: 200 })
128-
}
99+
export const getParentPluginList = async (appId?: number): Promise<ResponseType<MinParentPluginDTO[]>> =>
100+
get<MinParentPluginDTO[]>(getUrlWithSearchParams(ROUTES.PLUGIN_LIST_MIN, { appId }))

src/Shared/Components/Plugin/types.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ export interface PluginTagNamesDTO {
1717
tagNames: string[]
1818
}
1919

20-
export interface MinParentPluginDTO {
21-
id: number
22-
pluginName: string
23-
icon: string
24-
}
25-
2620
/**
2721
* Minimal data of child plugins
2822
*/
@@ -60,6 +54,8 @@ export interface ParentPluginDTO {
6054
pluginIdentifier: string
6155
}
6256

57+
export interface MinParentPluginDTO extends Pick<ParentPluginDTO, 'id' | 'name' | 'icon'> {}
58+
6359
export interface PluginDetailDTO {
6460
parentPlugins: ParentPluginDTO[]
6561
totalCount: number

0 commit comments

Comments
 (0)