Fixed admin header not being set properly.
Incorrectly used Boolean(). Now we check for the header value by string comparison, should always return boolean.
This commit is contained in:
@@ -31,8 +31,8 @@ const allRequestedWines = () => {
|
|||||||
|
|
||||||
return fetch(url.href)
|
return fetch(url.href)
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
const isAdmin = resp.headers.get("vinlottis-admin") || false;
|
const isAdmin = resp.headers.get("vinlottis-admin") == "true";
|
||||||
return Promise.all([resp.json(), Boolean(isAdmin)]);
|
return Promise.all([resp.json(), isAdmin]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user