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)
|
||||
.then(resp => {
|
||||
const isAdmin = resp.headers.get("vinlottis-admin") || false;
|
||||
return Promise.all([resp.json(), Boolean(isAdmin)]);
|
||||
const isAdmin = resp.headers.get("vinlottis-admin") == "true";
|
||||
return Promise.all([resp.json(), isAdmin]);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user