create scripts for guestbook

create script for adding comment
create script for listing comments
will need to wire up with webpage
This commit is contained in:
emma 2025-02-22 10:40:27 -05:00
parent 6ad3bc0cfd
commit 2a3401074d
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,12 @@
import { createClient } from "@supabase/supabase-js";
// Create a single supabase client for interacting with your database
const supabase = createClient(
"https://kddqzqkvjumaslnljhqv.supabase.co",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtkZHF6cWt2anVtYXNsbmxqaHF2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAyMDM5NTEsImV4cCI6MjA1NTc3OTk1MX0.wXhRoE7Jh2aaCdPlBiqEI7F4yj8-7beoeWEPvtVn0kg"
);
const { data, error } = await supabase
.from("guestbook-comments")
.select()
.eq("approved", true);

View File

@ -10,5 +10,5 @@ const { error } = await supabase.from("guestbook-comments").insert({
name: "emma", name: "emma",
website: "https://emmas.place", website: "https://emmas.place",
comment: "lmao", comment: "lmao",
"bot-check": 38, "bot-check": 17,
}); });