first commit

This commit is contained in:
Your NamebaishaliHolocron
2026-06-15 12:57:03 +05:30
commit b9ac5ae0b2
398 changed files with 49583 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import { UUID } from "crypto";
import { baseApiRequest } from "../apiRequests/baseApiRequest";
const PROJECT_API = `${process.env.NEXT_PUBLIC_PROJECT_MANAGEMENT_API_URL}/api/v1/projects`;
const USER_API =
"https://ikoncloud-dev.keross.com/ikon-api/platform/user/current";
// READ
export const getAllProductsByProject = async (projectIdentifier: UUID) => {
return baseApiRequest(
`${PROJECT_API}/${projectIdentifier}/products`,
{
method: "GET",
cache: "no-store", // optional but recommended for fresh data
},
{ isAccessTokenRequird: true },
);
};
export const getProductById = async (projectId: UUID, productIdentifier: UUID) => {
return baseApiRequest(
`${PROJECT_API}/${projectId}/products/${productIdentifier}`,
{
method: "GET",
cache: "no-store",
},
{ isAccessTokenRequird: true }
);
};
// UPDATE
export const updateProduct = async (projectId: UUID, productIdentifier: UUID, updatedProduct: any) => {
return baseApiRequest(
`${PROJECT_API}/${projectId}/products/${productIdentifier}`,
{
method: "PUT",
body: JSON.stringify(updatedProduct),
},
{ isAccessTokenRequird: true },
);
};