Skip to content

Commit fd792c7

Browse files
committed
fix: convert getPluginsDetail params to plural names
1 parent edd81a6 commit fd792c7

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

src/Shared/Components/Plugin/PluginList.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import PluginCard from './PluginCard'
44
import { DetectBottom } from '../DetectBottom'
55
import PluginCardSkeletonList from './PluginCardSkeletonList'
66
import { PluginListParamsType, PluginListProps } from './types'
7-
import {
8-
abortPreviousRequests,
9-
GenericEmptyState,
10-
GenericFilterEmptyState,
11-
getIsRequestAborted,
12-
showError,
13-
} from '../../../Common'
7+
import { abortPreviousRequests, GenericEmptyState, GenericFilterEmptyState, ImageType } from '../../../Common'
148
import { getPluginStoreData } from './service'
159

1610
const PluginList = ({
@@ -46,17 +40,15 @@ const PluginList = ({
4640

4741
handleDataUpdateForPluginResponse(pluginDataResponse, true)
4842
} catch (error) {
49-
if (!getIsRequestAborted(error)) {
50-
showError(error)
51-
}
43+
// Do nothing
5244
} finally {
5345
setIsLoadingMorePlugins(false)
5446
}
5547
}
5648

5749
if (!pluginList.length) {
5850
if (!!searchKey || !!selectedTags.length) {
59-
return <GenericFilterEmptyState handleClearFilters={handleClearFilters} />
51+
return <GenericFilterEmptyState handleClearFilters={handleClearFilters} imageType={ImageType.Large} />
6052
}
6153

6254
// Not going to happen but still handling in case of any issue that might arise

src/Shared/Components/Plugin/service.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import { parsePluginDetailsDTOIntoPluginStore } from './utils'
1414

1515
export const getPluginsDetail = async ({
1616
appId,
17-
parentPluginId,
18-
pluginId,
17+
parentPluginIds,
18+
pluginIds,
1919
}: PluginDetailServiceParamsType): Promise<Pick<GetPluginStoreDataReturnType, 'pluginStore'>> => {
2020
try {
2121
const payload: PluginDetailPayloadType = {
2222
appId,
23-
parentPluginId,
24-
pluginId,
23+
parentPluginId: parentPluginIds,
24+
pluginId: pluginIds,
2525
}
2626

2727
const { result } = (await get(
@@ -60,7 +60,7 @@ export const getPluginStoreData = async ({
6060

6161
const pluginStore = parsePluginDetailsDTOIntoPluginStore(result?.parentPlugins)
6262
return {
63-
totalCount: result.totalCount,
63+
totalCount: result?.totalCount || 0,
6464
pluginStore,
6565
}
6666
} catch (error) {

src/Shared/Components/Plugin/types.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ export interface PluginDetailDTO {
6060

6161
export interface PluginDetailServiceParamsType {
6262
appId: number
63-
pluginId?: number[]
64-
parentPluginId?: number[]
63+
pluginIds?: number[]
64+
parentPluginIds?: number[]
6565
}
6666

67-
export interface PluginDetailPayloadType extends PluginDetailServiceParamsType {}
67+
export interface PluginDetailPayloadType extends Pick<PluginDetailServiceParamsType, 'appId'> {
68+
pluginId?: PluginDetailServiceParamsType['pluginIds']
69+
parentPluginId?: PluginDetailServiceParamsType['parentPluginIds']
70+
}
6871

6972
export interface PluginListFiltersType extends Pick<BaseFilterQueryParams<unknown>, 'searchKey'> {
7073
selectedTags: string[]

0 commit comments

Comments
 (0)