From 0018627afee24d3f01eec2d1eb8933f556fbf958 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Tue, 11 Apr 2023 12:28:06 +0600 Subject: [PATCH] chore: get user resource progress api --- src/lib/progress-api.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/progress-api.ts b/src/lib/progress-api.ts index a9a42c8ce..6fe3e2d04 100644 --- a/src/lib/progress-api.ts +++ b/src/lib/progress-api.ts @@ -1,4 +1,4 @@ -import { httpPatch } from './http'; +import { httpGet, httpPatch } from './http'; export async function toggleMarkResourceDoneApi({ resourceId, @@ -17,3 +17,18 @@ export async function toggleMarkResourceDoneApi({ topicId, }); } + +export async function getUserResourceProgressApi({ + resourceId, + resourceType, +}: { + resourceId: string; + resourceType: 'roadmap' | 'best-practice'; +}) { + return await httpGet<{ + done: string[]; + }>(`${import.meta.env.PUBLIC_API_URL}/v1-get-user-resource-progress`, { + resourceId, + resourceType, + }); +}