Revert "x"

This reverts commit 330bd1ff61.
This commit is contained in:
Omar Najjar 2025-04-30 19:46:18 +10:00
parent 3c675a7a0a
commit 927313e8da
2 changed files with 4 additions and 32 deletions

View file

@ -757,19 +757,6 @@ async function safeFetch(url, options = {}) {
console.error('Error fetching proposals:', error);
showErrorMessage('Failed to load petitions. Please check the console for details.', true);
}
// Hide loading indicator
function hideLoadingIndicator() {
const proposalsContainer = document.getElementById('proposals-container');
if (proposalsContainer) {
// Only remove if it exists
const loadingIndicator = proposalsContainer.querySelector('.loading-indicator');
if (loadingIndicator) {
loadingIndicator.remove();
}
}
}
}
// Function to render all proposals

View file

@ -2,11 +2,7 @@
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
<<<<<<< Updated upstream
'Access-Control-Allow-Headers': 'Content-Type, Authorization, Accept',
=======
'Access-Control-Allow-Headers': 'Content-Type, Authorization, Accept, Cache-Control, X-Requested-With',
>>>>>>> Stashed changes
'Access-Control-Max-Age': '86400'
};
@ -15,21 +11,10 @@ const DEFAULT_PAGE_SIZE = 20;
const MAX_PAGE_SIZE = 100;
// Handle OPTIONS request for CORS preflight
function handleOptions(request) {
if (
request.headers.get('Origin') !== null &&
request.headers.get('Access-Control-Request-Method') !== null &&
request.headers.get('Access-Control-Request-Headers') !== null
) {
return new Response(null, {
headers: corsHeaders,
status: 204
});
} else {
return new Response(null, {
headers: corsHeaders
});
}
function handleOptions() {
return new Response(null, {
headers: corsHeaders
});
}
// Helper to create standardized responses