Skip to content

Commit 01f6440

Browse files
authored
fix(application request): use different end point for company credential and registration (eclipse-tractusx#1229)
1 parent 408a75e commit 01f6440

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
- **Service Subscriptions**
2323

2424
- rename 'Configure' button to 'Activate' button [#1150](https://github.com/eclipse-tractusx/portal-frontend/pull/1150)
25+
- **Application Request**
26+
- add separate end points for downloading company credential document and registration document [#1229](https://github.com/eclipse-tractusx/portal-frontend/pull/1229)
2527
- **Business Partner Invitation**
2628
- support all language characters for company names [#1189](https://github.com/eclipse-tractusx/portal-frontend/pull/1189)
2729

src/components/pages/AdminCredential/AdminCredentialElements.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import {
2929
useRevokeCredentialMutation,
3030
useFetchCredentialsSearchQuery,
3131
StatusEnum,
32+
useFetchSsiDocumentByIdMutation,
3233
} from 'features/certification/certificationApiSlice'
3334
import { download } from 'utils/downloadUtils'
34-
import { useFetchNewDocumentByIdMutation } from 'features/appManagement/apiSlice'
3535
import { error, success } from 'services/NotifyService'
3636
import { uniqueId } from 'lodash'
3737
import { setSearchInput } from 'features/appManagement/actions'
@@ -93,7 +93,7 @@ export default function AdminCredentialElements() {
9393
const [credentialData, setCredentialData] = useState<CredentialData>()
9494
const [revokeLoading, setRevokeLoading] = useState<boolean>(false)
9595

96-
const [getDocumentById] = useFetchNewDocumentByIdMutation()
96+
const [getDocumentById] = useFetchSsiDocumentByIdMutation()
9797
const [approveCredential] = useApproveCredentialMutation()
9898
const [declineCredential] = useDeclineCredentialMutation()
9999
const [revokeCredential] = useRevokeCredentialMutation()

src/features/appManagement/apiSlice.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
2222
import { apiBaseQuery } from 'utils/rtkUtil'
2323
import type { AppStatusDataState } from './types'
2424
import i18next from 'i18next'
25-
import { getSsiBase } from 'services/EnvironmentService'
2625

2726
export type useCasesItem = {
2827
useCaseId: string
@@ -324,7 +323,7 @@ export const apiSlice = createApi({
324323
}),
325324
fetchNewDocumentById: builder.mutation({
326325
query: (documentId) => ({
327-
url: `${getSsiBase()}/api/credential/documents/${documentId}`,
326+
url: `/api/registration/documents/${documentId}`,
328327
responseHandler: async (response) => ({
329328
headers: response.headers,
330329
data: await response.blob(),

src/features/certification/certificationApiSlice.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ export const apiSlice = createApi({
142142
method: 'POST',
143143
}),
144144
}),
145+
fetchSsiDocumentById: builder.mutation({
146+
query: (documentId) => ({
147+
url: `${getSsiBase()}/api/credential/documents/${documentId}`,
148+
responseHandler: async (response) => ({
149+
headers: response.headers,
150+
data: await response.blob(),
151+
}),
152+
}),
153+
}),
145154
}),
146155
})
147156

@@ -153,4 +162,5 @@ export const {
153162
useDeclineCredentialMutation,
154163
useFetchCertificateTypesQuery,
155164
useRevokeCredentialMutation,
165+
useFetchSsiDocumentByIdMutation,
156166
} = apiSlice

0 commit comments

Comments
 (0)