const API_BASE = 'https://my-store-project.earthhubzaza.workers.dev/api'; // ฟังก์ชันแทนที่ google.script.run สำหรับหน้าแรก const run = async (fn, ...args) => { let endpoint = ''; let payload = {}; if (fn === 'getPublicData') { const res = await fetch(`${API_BASE}/public-data`); return await res.json(); } else if (fn === 'submitReview') { endpoint = '/submit-review'; payload = args[0]; } const res = await fetch(`${API_BASE}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); return await res.json(); };