endpoint for cloud user
This commit is contained in:
parent
ef92ec8aea
commit
5a8bd8493f
2 changed files with 6 additions and 7 deletions
|
|
@ -52,12 +52,7 @@ const CloudPhoneSettings = observer((props: CloudPhoneSettingsProps) => {
|
|||
};
|
||||
|
||||
const getCloudUserInfo = async () => {
|
||||
await store.cloudStore.updateItems();
|
||||
const { count, results } = await store.cloudStore.getSearchResult();
|
||||
console.log('RES', results);
|
||||
const cloudUser =
|
||||
results && (await results.find((element: { id: string }) => element.id === store.userStore.currentUserPk));
|
||||
console.log('CLOUD USER', cloudUser);
|
||||
const cloudUser = await store.cloudStore.getCloudUser(store.userStore.currentUserPk);
|
||||
setUserStatus(cloudUser?.cloud_data?.status);
|
||||
setUserLink(cloudUser?.cloud_data?.link);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -59,7 +59,11 @@ export class CloudStore extends BaseStore {
|
|||
}
|
||||
|
||||
async syncCloudUser(id: string) {
|
||||
return await makeRequest(`${this.path}${id}/sync/`, { method: 'POST' });
|
||||
return await makeRequest(`${this.path}`, { method: 'POST' });
|
||||
}
|
||||
|
||||
async getCloudUser(id: string) {
|
||||
return await makeRequest(`${this.path}${id}`, { method: 'GET' });
|
||||
}
|
||||
|
||||
async getCloudConnectionStatus() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue