Save current app progress
This commit is contained in:
28
scratch_db_test.js
Normal file
28
scratch_db_test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const supabaseUrl = "https://qyvnryhskgmvgjajqqru.supabase.co";
|
||||
const supabaseKey = "sb_publishable_fazCCLmO7XjtryY28ePR-A_CS7aU6fF";
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const res = await fetch(`${supabaseUrl}/rest/v1/trips`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
apikey: supabaseKey,
|
||||
Authorization: `Bearer ${supabaseKey}`,
|
||||
"Content-Type": "application/json",
|
||||
Prefer: "return=representation"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
title: "Test Trip",
|
||||
origin: "Lisbon",
|
||||
destination: "Porto",
|
||||
waypoints: []
|
||||
})
|
||||
});
|
||||
const data = await res.json();
|
||||
console.log("INSERT_RESPONSE:", JSON.stringify(data, null, 2));
|
||||
} catch (err) {
|
||||
console.error("Error inserting:", err);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user