Skip to content

Commit

Permalink
fix(app subscription): fix blank page on autosetup call (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhigarg-bmw authored May 24, 2024
1 parent e1114b6 commit 6182518
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2.0.0-RC9

### Bugfix

- App Subscription
- Blank Page fix on autosetup call

## 2.0.0-RC8

### Feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ActivateSubscriptionOverlay = ({
const [URLErrorMsg, setURLErrorMessage] = useState('')
const [loading, setLoading] = useState(false)
const [activationResponse, setActivationResponse] =
useState<SubscriptionActivationResponse[]>()
useState<SubscriptionActivationResponse>()

const [addUserSubscribtion] = useAddUserSubscribtionMutation()
const { data } = useFetchTechnicalUserProfilesQuery(appId)
Expand All @@ -102,6 +102,7 @@ const ActivateSubscriptionOverlay = ({
} catch (error) {
console.log(error)
}
setLoading(false)
}

const closeActivationOverlay = () => {
Expand All @@ -117,30 +118,31 @@ const ActivateSubscriptionOverlay = ({
],
}

const activationData = activationResponse?.map(
(userdata: SubscriptionActivationResponse) => [
[
t('content.appSubscription.activation.appClientId'),
`${userdata?.clientInfo?.clientId}`,
],
const activationData = activationResponse?.technicalUserInfo
?.map((userdata) => [
[
t('content.appSubscription.activation.technicalClientId'),
`${userdata?.technicalUserInfo?.technicalClientId}`,
`${userdata?.technicalClientId}`,
],
[
t('content.appSubscription.activation.technicalSecret'),
`${userdata?.technicalUserInfo?.technicalUserSecret}`,
`${userdata?.technicalUserSecret}`,
],
[
t('content.appSubscription.activation.technicalPermission'),
`${userdata?.technicalUserInfo?.technicalUserPermissions.toString()}`,
`${userdata?.technicalUserPermissions?.toString()}`,
],
]
)
])
.flat(1)

activationData?.unshift([
t('content.appSubscription.activation.appClientId'),
`${activationResponse?.clientInfo?.clientId}`,
])

const tableData2: TableType = {
head: [t('content.appSubscription.activation.technicalDetails'), ''],
body: activationData?.flat(1) ?? [],
body: activationData ?? [],
}

return (
Expand Down
6 changes: 3 additions & 3 deletions src/features/appSubscription/appSubscriptionApiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ export type SubscriptionStoreRequest = {
}

export type SubscriptionActivationResponse = {
technicalUserInfo: {
technicalUserInfo: Array<{
technicalUserId: string
technicalUserSecret: string
technicalClientId: string
technicalUserPermissions: string[]
}
}>
clientInfo: {
clientId: string
clientUrl: string
Expand Down Expand Up @@ -170,7 +170,7 @@ export const apiSlice = createApi({
`/api/apps/${body.appId}/subscription/${body.subscriptionId}/provider`,
}),
addUserSubscribtion: builder.mutation<
SubscriptionActivationResponse[],
SubscriptionActivationResponse,
SubscriptionStoreRequest
>({
query: (data: SubscriptionStoreRequest) => ({
Expand Down

0 comments on commit 6182518

Please sign in to comment.