diff --git a/src/api/public.js b/src/api/public.js index 573f97c7c..0acd95a18 100644 --- a/src/api/public.js +++ b/src/api/public.js @@ -110,7 +110,7 @@ export const fetchUserByName = ({ name, credentials }) => credentials, params: { acct: name }, }) - .then((data) => data.id) + .then(({ data }) => data.id) .catch((error) => { if (error && error.statusCode === 404) { // Either the backend does not support lookup endpoint, diff --git a/src/services/follow_manipulate/follow_manipulate.js b/src/services/follow_manipulate/follow_manipulate.js index 31b1686e9..759ba67d9 100644 --- a/src/services/follow_manipulate/follow_manipulate.js +++ b/src/services/follow_manipulate/follow_manipulate.js @@ -13,7 +13,7 @@ const fetchRelationship = (attempt, userId, store) => id: userId, credentials: useOAuthStore().token, }) - .then((relationship) => { + .then(({ data: relationship }) => { store.commit('updateUserRelationship', [relationship]) return relationship }) @@ -36,7 +36,7 @@ const fetchRelationship = (attempt, userId, store) => }) export const requestFollow = async (userId, store) => { - const updated = await followUser({ + const { data: updated } = await followUser({ id: userId, credentials: useOAuthStore().token, }) @@ -58,7 +58,7 @@ export const requestFollow = async (userId, store) => { } export const requestUnfollow = async (userId, store) => { - const updated = await unfollowUser({ + const { data: updated } = await unfollowUser({ id: userId, credentials: useOAuthStore().token, })