From d794f5757cf8ea94039dea27f55cfebe10d3d1ec Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 28 Oct 2022 10:06:36 +0300 Subject: Fetch profiles directly --- vnext/src/api/index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'vnext/src') 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); }); } -- cgit v1.2.3