blink/frontend/vanilla/js/utils.js

15 lines
435 B
JavaScript
Raw Normal View History

2024-02-28 15:51:21 +01:00
function getCookie(name) {
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i].trim();
const [cookieName, cookieValue] = cookie.split('=');
if (cookieName === name) {
return decodeURIComponent(cookieValue);
}
}
return null;
2024-03-14 15:45:10 +01:00
}
function callbackErrors(errors, func) {
errors.forEach(error => func(error.msg));
2024-02-28 15:51:21 +01:00
}