Fix formatting

This commit is contained in:
Taylor Wilsdon 2024-12-16 15:11:05 -05:00
parent bf9ff1af56
commit a27df11c02

View File

@ -4,17 +4,17 @@ let CLIENT_ID = '';
// Function to fetch credentials from backend config // Function to fetch credentials from backend config
async function getCredentials() { async function getCredentials() {
const response = await fetch('/api/config'); const response = await fetch('/api/config');
if (!response.ok) { if (!response.ok) {
throw new Error('Failed to fetch Google Drive credentials'); throw new Error('Failed to fetch Google Drive credentials');
} }
const config = await response.json(); const config = await response.json();
API_KEY = config.google_drive?.api_key; API_KEY = config.google_drive?.api_key;
CLIENT_ID = config.google_drive?.client_id; CLIENT_ID = config.google_drive?.client_id;
if (!API_KEY || !CLIENT_ID) { if (!API_KEY || !CLIENT_ID) {
throw new Error('Google Drive API credentials not configured'); throw new Error('Google Drive API credentials not configured');
} }
} }
const SCOPE = [ const SCOPE = [
'https://www.googleapis.com/auth/drive.readonly', 'https://www.googleapis.com/auth/drive.readonly',