diff --git a/src/api/relationships.ts b/src/api/relationships.ts index 848e757..0ea817c 100644 --- a/src/api/relationships.ts +++ b/src/api/relationships.ts @@ -1,5 +1,6 @@ import { BACKEND_URL } from "@/constants" import { http } from "./common" +import { Profile } from "./users" export interface Relationship { id: string, @@ -58,3 +59,23 @@ export async function unfollow( return data } } + +export async function getFollowers( + authToken: string, + accountId: string, +): Promise { + const url = `${BACKEND_URL}/api/v1/accounts/${accountId}/followers` + const response = await http(url, { authToken }) + const data = await response.json() + return data +} + +export async function getFollowing( + authToken: string, + accountId: string, +): Promise { + const url = `${BACKEND_URL}/api/v1/accounts/${accountId}/following` + const response = await http(url, { authToken }) + const data = await response.json() + return data +} diff --git a/src/router/index.ts b/src/router/index.ts index 165c072..acb62b2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -86,6 +86,12 @@ const routes: Array = [ component: ProfileView, meta: { }, }, + { + path: "/profile/:profileId/:tabName", + name: "profile-tab", + component: ProfileView, + meta: { onlyAuthenticated: true }, + }, { path: "/profile-directory", name: "profile-directory", diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 8226913..3b22d3c 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -1,7 +1,7 @@