From 38b1cf4b338b64e53d5092fd4ad35581b0eae083 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Tue, 11 Apr 2023 12:08:07 +0600 Subject: [PATCH] chore: toggle mark resource done api --- src/lib/progress-api.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/lib/progress-api.ts diff --git a/src/lib/progress-api.ts b/src/lib/progress-api.ts new file mode 100644 index 000000000..a9a42c8ce --- /dev/null +++ b/src/lib/progress-api.ts @@ -0,0 +1,19 @@ +import { httpPatch } from './http'; + +export async function toggleMarkResourceDoneApi({ + resourceId, + resourceType, + topicId, +}: { + resourceId: string; + resourceType: 'roadmap' | 'best-practice'; + topicId: string; +}) { + return await httpPatch<{ + status: 'ok'; + }>(`${import.meta.env.PUBLIC_API_URL}/v1-toggle-mark-resource-done`, { + resourceId, + resourceType, + topicId, + }); +}