added getUserDeatils api
This commit is contained in:
parent
ab325dce59
commit
b1798fd5b3
|
@ -8,6 +8,7 @@ import { getToken } from 'utils/common/key';
|
||||||
import HTTPService from './HTTPService';
|
import HTTPService from './HTTPService';
|
||||||
import { B64EncryptionResult } from './uploadService';
|
import { B64EncryptionResult } from './uploadService';
|
||||||
import { logError } from 'utils/sentry';
|
import { logError } from 'utils/sentry';
|
||||||
|
import { Subscription } from './billingService';
|
||||||
|
|
||||||
export interface UpdatedKey {
|
export interface UpdatedKey {
|
||||||
kekSalt: string;
|
kekSalt: string;
|
||||||
|
@ -55,6 +56,14 @@ export interface TwoFactorRecoveryResponse {
|
||||||
secretDecryptionNonce: string
|
secretDecryptionNonce: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UserDetails{
|
||||||
|
email:string;
|
||||||
|
usage:string;
|
||||||
|
fileCount:number;
|
||||||
|
sharedCollectionCount:number;
|
||||||
|
subscription:Subscription;
|
||||||
|
}
|
||||||
|
|
||||||
export const getOtt = (email: string) => HTTPService.get(`${ENDPOINT}/users/ott`, {
|
export const getOtt = (email: string) => HTTPService.get(`${ENDPOINT}/users/ott`, {
|
||||||
email,
|
email,
|
||||||
client: 'web',
|
client: 'web',
|
||||||
|
@ -208,3 +217,16 @@ export const changeEmail=async (email:string, ott:string)=>{
|
||||||
'X-Auth-Token': getToken(),
|
'X-Auth-Token': getToken(),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getUserDetails = async ():Promise<UserDetails> => {
|
||||||
|
const token = getToken();
|
||||||
|
|
||||||
|
const resp = await HTTPService.get(
|
||||||
|
`${ENDPOINT}/users/details`,
|
||||||
|
null,
|
||||||
|
{
|
||||||
|
'X-Auth-Token': token,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return resp.data['details'];
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue