👔 feat: add save button endpoint handler

This commit is contained in:
2026-03-29 11:34:08 +07:00
parent 6f2588250c
commit 99bf72c1af
3 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,18 @@
"use server";
import { backendFetch } from "@/shared/helpers/backendFetch";
export const addHeroBannerMediaToSaved = async (mediaId: string) => {
try {
return await backendFetch("collections/sys", {
method: "POST",
body: JSON.stringify({
name: "Saved",
itemId: mediaId,
}),
});
} catch (error) {
console.error("Error adding media to saved list:", error);
return { success: false, message: "Failed to add media to saved list." };
}
};