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:
2020-09-23 23:20:20 +02:00
parent b0b99ed921
commit 8d8550a835

View File

@@ -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]);
});
};