add getAccountDeleteChallenge api
This commit is contained in:
parent
815111890b
commit
aafc3af100
|
@ -16,6 +16,7 @@ import {
|
|||
TwoFactorVerificationResponse,
|
||||
TwoFactorRecoveryResponse,
|
||||
UserDetails,
|
||||
DeleteChallengeResponse,
|
||||
} from 'types/user';
|
||||
import { getLocalFamilyData, isPartOfFamily } from 'utils/billing';
|
||||
import { ServerErrorCodes } from 'utils/error';
|
||||
|
@ -324,3 +325,21 @@ export const getFamilyPortalRedirectURL = async () => {
|
|||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
export const getAccountDeleteChallenge = async () => {
|
||||
try {
|
||||
const token = getToken();
|
||||
|
||||
const resp = await HTTPService.get(
|
||||
`${ENDPOINT}/users/delete-challenge`,
|
||||
null,
|
||||
{
|
||||
'X-Auth-Token': token,
|
||||
}
|
||||
);
|
||||
return resp.data as DeleteChallengeResponse;
|
||||
} catch (e) {
|
||||
logError(e, 'failed to get roadmap url');
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -87,3 +87,8 @@ export interface UserDetails {
|
|||
subscription: Subscription;
|
||||
familyData?: FamilyData;
|
||||
}
|
||||
|
||||
export interface DeleteChallengeResponse {
|
||||
allowDelete: boolean;
|
||||
encryptedChallenge: string;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue