Skip to content

Commit a80a176

Browse files
committed
fix: payload for getPluginsDetails
1 parent 0122713 commit a80a176

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

src/Common/Policy.Types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export type ProcessPluginDataParamsType = {
9595
/**
9696
* Would be sent in case we have to get data for steps
9797
*/
98-
requiredPluginIds?: PluginDetailPayloadType['pluginId']
98+
requiredPluginIds?: PluginDetailPayloadType['pluginIds']
9999
} & (ProcessPluginDataCIParamsType | ProcessPluginDataCDParamsType)
100100

101101
export enum ConsequenceAction {

src/Shared/Components/Plugin/service.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { get, getIsRequestAborted, getUrlWithSearchParams, ResponseType, ROUTES, showError } from '../../../Common'
17+
import {
18+
get,
19+
getIsRequestAborted,
20+
getUrlWithSearchParams,
21+
post,
22+
ResponseType,
23+
ROUTES,
24+
showError,
25+
} from '../../../Common'
1826
import { stringComparatorBySortOrder } from '../../Helpers'
1927
import {
2028
GetParentPluginListPayloadType,
@@ -41,13 +49,14 @@ export const getPluginsDetail = async ({
4149
try {
4250
const payload: PluginDetailPayloadType = {
4351
appId,
44-
parentPluginId: parentPluginIds,
45-
pluginId: pluginIds,
46-
parentPluginIdentifier: parentPluginIdentifiers ? `${parentPluginIdentifiers}` : null,
52+
parentPluginIds,
53+
pluginIds,
54+
parentPluginIdentifiers,
4755
}
4856

49-
const { result } = await get<PluginDetailDTO>(
50-
getUrlWithSearchParams(ROUTES.PLUGIN_GLOBAL_LIST_DETAIL_V2, payload),
57+
const { result } = await post<PluginDetailDTO, PluginDetailPayloadType>(
58+
ROUTES.PLUGIN_GLOBAL_LIST_DETAIL_V2,
59+
payload,
5160
{ signal },
5261
)
5362

src/Shared/Components/Plugin/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ export interface PluginDetailServiceParamsType {
9494
signal?: AbortSignal
9595
}
9696

97-
export interface PluginDetailPayloadType extends Pick<PluginDetailServiceParamsType, 'appId'> {
98-
pluginId?: PluginDetailServiceParamsType['pluginIds']
99-
parentPluginId?: PluginDetailServiceParamsType['parentPluginIds']
100-
parentPluginIdentifier?: PluginDetailServiceParamsType['parentPluginIdentifiers'][number]
101-
}
97+
export interface PluginDetailPayloadType
98+
extends Pick<
99+
PluginDetailServiceParamsType,
100+
'appId' | 'parentPluginIds' | 'pluginIds' | 'parentPluginIdentifiers'
101+
> {}
102102

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

0 commit comments

Comments
 (0)