refactor .env usage due to unexpexted env values
This commit is contained in:
@ -133,7 +133,7 @@ export const getServerSideProps = async (context) => {
|
||||
|
||||
const role = session?.user.role;
|
||||
console.log("server role: " + role);
|
||||
var queryUrl = process.env.NEXTAUTH_URL + "/api/data/availabilities?select=id,name,isActive,dayofweek,dayOfMonth,startTime,endTime,publisher.firstName,publisher.lastName,publisher.id";
|
||||
var queryUrl = process.env.PUBLIC_URL + "/api/data/availabilities?select=id,name,isActive,dayofweek,dayOfMonth,startTime,endTime,publisher.firstName,publisher.lastName,publisher.id";
|
||||
if (role === UserRole.USER || context.query.my) {
|
||||
queryUrl += `&where={"publisherId":"${session?.user.id}"}`;
|
||||
} else if (role == UserRole.ADMIN) {
|
||||
@ -145,7 +145,7 @@ export const getServerSideProps = async (context) => {
|
||||
}
|
||||
var resp = await axios.get(
|
||||
queryUrl
|
||||
// process.env.NEXTAUTH_URL + "/api/data/availabilities?include=publisher",
|
||||
// process.env.PUBLIC_URL + "/api/data/availabilities?include=publisher",
|
||||
, { decompress: true });
|
||||
var items = resp.data;
|
||||
console.log("got " + items.length + " availabilities");
|
||||
|
@ -31,7 +31,7 @@ export const getServerSideProps = async (context) => {
|
||||
};
|
||||
}
|
||||
const { data: item } = await axios.get(
|
||||
process.env.NEXTAUTH_URL + "/api/data/availabilities/" + context.params.id
|
||||
process.env.PUBLIC_URL + "/api/data/availabilities/" + context.params.id
|
||||
);
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user