Closed wrycode closed 5 days ago
I confirmed that it works with the frontend. I'm still leaving it up to you guys how to design the API.js file, but for reference the test function I used was this:
const getTypes = async (accessToken, callback) => { try { const response = await fetch(config.backend_endpoint + '/api/private/preferences_to_types', { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ input_list: ['food', 'alcohol', 'family friendly'] }) }); const data = await response.json(); console.log("Data response form API: ", data) callback(data); } catch (error) { console.error('Error:', error); } };
I confirmed that it works with the frontend. I'm still leaving it up to you guys how to design the API.js file, but for reference the test function I used was this: