---------- set bearer token-----------
const token = pm.environment.get("TOKEN");

console.log(token)

if (!token) {
    console.error("Token is not set in the environment.");
    throw new Error("Token is missing. Please set the token in the environment.");
}

pm.request.headers.add({
    key: "Authorization",
    value: `Bearer ${token}`
});