Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/app/_utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const createGroup = async (groupName: string, access_token: string) => {
return data;
};

const saveContentToGroup = async (
const saveContentToGroup_Deprecated = async (
groupName: string | null,
contentId: string | null,
access_token: string
Expand All @@ -274,6 +274,29 @@ const saveContentToGroup = async (
return data;
};

const saveContentToGroup = async (
groupName: string | null,
contentId: string | null,
access_token: string
) => {
fetchUrl.pathname = `/api/bookmark/v1/groups/${groupName}/contents/${contentId}`;

const data = await fetch(fetchUrl.href, {
method: "PUT",
headers: {
"Content-Type": "application/json;charset=UTF-8",
Accept: "application/json",
Authorization: `Bearer ${access_token}`,
},
});

if (!data.ok) {
throw new Error("API Error");
}

return data;
};

const getContentListInGroup = async (
groupName: string,
access_token: string
Expand Down
Loading