diff options
author | Vitaly Takmazov | 2022-10-28 10:06:36 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | d794f5757cf8ea94039dea27f55cfebe10d3d1ec (patch) | |
tree | 151509ab52d82452a2afd4efa511a155226ad49b | |
parent | dec592d9d3be8936455b4caaa9a07f7fec3d3a70 (diff) |
Fetch profiles directly
-rw-r--r-- | vnext/src/api/index.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vnext/src/api/index.js b/vnext/src/api/index.js index 8f452b82..f88695f2 100644 --- a/vnext/src/api/index.js +++ b/vnext/src/api/index.js @@ -96,7 +96,7 @@ export function me(username = '', password = '') { cookies.set('hash', visitor.hash, { path: '/' }); resolve(visitor); }).catch(reason => { - cookies.remove('hash', { path: '/'}); + cookies.remove('hash', { path: '/' }); reject(reason); }); }); @@ -214,12 +214,16 @@ export function markReadTracker(msg, visitor) { } /** - * @param {string} dataUri + * Fetch user profile + * + * @param {string} profileUrl User profile URL */ -export function fetchUserUri(dataUri) { +export function fetchUserUri(profileUrl) { return new Promise((resolve, reject) => { - let form = new FormData(); - form.append('uri', dataUri); - client.post('/u/', form).then(response => resolve(response)).catch(reject); + client.get(profileUrl, { + headers: { + 'Accept': 'application/ld+json' + } + }).then(response => resolve(response)).catch(reject); }); } |