Skip to content

Commit

Permalink
fix(application request): use different end point for company credent…
Browse files Browse the repository at this point in the history
…ial and registration (#1229)
  • Loading branch information
manojava-gk authored Oct 16, 2024
1 parent 408a75e commit 01f6440
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- **Service Subscriptions**

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import {
useRevokeCredentialMutation,
useFetchCredentialsSearchQuery,
StatusEnum,
useFetchSsiDocumentByIdMutation,
} from 'features/certification/certificationApiSlice'
import { download } from 'utils/downloadUtils'
import { useFetchNewDocumentByIdMutation } from 'features/appManagement/apiSlice'
import { error, success } from 'services/NotifyService'
import { uniqueId } from 'lodash'
import { setSearchInput } from 'features/appManagement/actions'
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function AdminCredentialElements() {
const [credentialData, setCredentialData] = useState<CredentialData>()
const [revokeLoading, setRevokeLoading] = useState<boolean>(false)

const [getDocumentById] = useFetchNewDocumentByIdMutation()
const [getDocumentById] = useFetchSsiDocumentByIdMutation()
const [approveCredential] = useApproveCredentialMutation()
const [declineCredential] = useDeclineCredentialMutation()
const [revokeCredential] = useRevokeCredentialMutation()
Expand Down
3 changes: 1 addition & 2 deletions src/features/appManagement/apiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
import { apiBaseQuery } from 'utils/rtkUtil'
import type { AppStatusDataState } from './types'
import i18next from 'i18next'
import { getSsiBase } from 'services/EnvironmentService'

export type useCasesItem = {
useCaseId: string
Expand Down Expand Up @@ -324,7 +323,7 @@ export const apiSlice = createApi({
}),
fetchNewDocumentById: builder.mutation({
query: (documentId) => ({
url: `${getSsiBase()}/api/credential/documents/${documentId}`,
url: `/api/registration/documents/${documentId}`,
responseHandler: async (response) => ({
headers: response.headers,
data: await response.blob(),
Expand Down
10 changes: 10 additions & 0 deletions src/features/certification/certificationApiSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ export const apiSlice = createApi({
method: 'POST',
}),
}),
fetchSsiDocumentById: builder.mutation({
query: (documentId) => ({
url: `${getSsiBase()}/api/credential/documents/${documentId}`,
responseHandler: async (response) => ({
headers: response.headers,
data: await response.blob(),
}),
}),
}),
}),
})

Expand All @@ -153,4 +162,5 @@ export const {
useDeclineCredentialMutation,
useFetchCertificateTypesQuery,
useRevokeCredentialMutation,
useFetchSsiDocumentByIdMutation,
} = apiSlice

0 comments on commit 01f6440

Please sign in to comment.