mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
[INJIMOB-2415] store the wellknown data as object in activity log file (#1733)
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
This commit is contained in:
@@ -269,19 +269,23 @@ export const getCredentialTypeFromWellKnown = (
|
||||
wellknown: IssuerWellknownResponse,
|
||||
credentialConfigurationId: string | undefined = undefined,
|
||||
): string => {
|
||||
if (credentialConfigurationId !== undefined) {
|
||||
const supportedCredentialsWellknown = getMatchingCredentialIssuerMetadata(
|
||||
wellknown,
|
||||
credentialConfigurationId,
|
||||
try {
|
||||
if (credentialConfigurationId !== undefined) {
|
||||
const supportedCredentialsWellknown = getMatchingCredentialIssuerMetadata(
|
||||
wellknown,
|
||||
credentialConfigurationId,
|
||||
);
|
||||
return getCredentialType(supportedCredentialsWellknown);
|
||||
}
|
||||
console.error(
|
||||
'credentialConfigurationId not available for fetching the Credential type',
|
||||
);
|
||||
return getCredentialType(supportedCredentialsWellknown);
|
||||
throw new Error(
|
||||
`Invalid credentialConfigurationId - ${credentialConfigurationId} passed`,
|
||||
);
|
||||
} catch (error) {
|
||||
return i18n.t('VcDetails:identityCard');
|
||||
}
|
||||
console.error(
|
||||
'credentialConfigurationId not available for fetching the Credential type',
|
||||
);
|
||||
throw new Error(
|
||||
`Invalid credentialConfigurationId - ${credentialConfigurationId} passed`,
|
||||
);
|
||||
};
|
||||
|
||||
export class Display {
|
||||
|
||||
@@ -6,6 +6,7 @@ import {StoreEvents} from './store';
|
||||
import {VCActivityLog} from '../components/ActivityLogEvent';
|
||||
import {IssuerWellknownResponse} from './VerifiableCredential/VCMetaMachine/vc';
|
||||
import {VPShareActivityLog} from '../components/VPShareActivityLogEvent';
|
||||
import {parseJSON} from '../shared/Utils';
|
||||
|
||||
const model = createModel(
|
||||
{
|
||||
@@ -155,6 +156,10 @@ export const activityLogMachine =
|
||||
|
||||
setAllWellknownConfigResponse: model.assign({
|
||||
wellKnownIssuerMap: (_, event) => {
|
||||
Object.entries(event.response).forEach(([key, value]) => {
|
||||
event.response[key] = parseJSON(value);
|
||||
});
|
||||
|
||||
return event.response as Record<string, Object>;
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user