chore: clean up diagnostic logs and update walkthrough

This commit is contained in:
2025-12-18 11:32:16 +01:00
parent 5923dd0474
commit 2685176992
2 changed files with 14 additions and 14 deletions

View File

@@ -154,8 +154,8 @@ export default function Home() {
</div> </div>
) : fetchError ? ( ) : fetchError ? (
<div className="p-8 bg-zinc-100 dark:bg-zinc-900/50 border border-zinc-200 dark:border-zinc-800 rounded-3xl text-center"> <div className="p-8 bg-zinc-100 dark:bg-zinc-900/50 border border-zinc-200 dark:border-zinc-800 rounded-3xl text-center">
<p className="text-zinc-800 dark:text-zinc-200 font-bold mb-2">Sammlung konnte nicht geladen werden</p> <p className="text-zinc-800 dark:text-zinc-200 font-bold mb-2">Die Sammlung konnte nicht geladen werden</p>
<p className="text-zinc-500 text-sm italic mb-4">Möglicherweise müssen die Datenbank-Regeln aktualisiert werden.</p> <p className="text-zinc-500 text-sm italic mb-4">Ein technischer Fehler ist aufgetreten.</p>
<button <button
onClick={fetchCollection} onClick={fetchCollection}
className="px-6 py-2 bg-amber-600 hover:bg-amber-700 text-white rounded-xl text-xs font-bold uppercase tracking-widest transition-all" className="px-6 py-2 bg-amber-600 hover:bg-amber-700 text-white rounded-xl text-xs font-bold uppercase tracking-widest transition-all"

View File

@@ -148,6 +148,14 @@ CREATE POLICY "Users can manage their own buddies" ON buddies
CREATE POLICY "Users can see buddies linked to their profile" ON buddies CREATE POLICY "Users can see buddies linked to their profile" ON buddies
FOR SELECT USING (buddy_profile_id = auth.uid()); FOR SELECT USING (buddy_profile_id = auth.uid());
-- TASTINGS (Core Table)
ALTER TABLE tastings ENABLE ROW LEVEL SECURITY;
-- SIMPLEST POLICY: You see your own stuff.
-- No subqueries = No recursion.
CREATE POLICY "tastings_owner_policy" ON tastings
FOR ALL USING (auth.uid() = user_id);
-- Policies for Tasting Sessions -- Policies for Tasting Sessions
ALTER TABLE tasting_sessions ENABLE ROW LEVEL SECURITY; ALTER TABLE tasting_sessions ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can manage their own sessions" ON tasting_sessions CREATE POLICY "Users can manage their own sessions" ON tasting_sessions
@@ -160,23 +168,15 @@ CREATE POLICY "Users can see sessions they participate in" ON tasting_sessions
) )
); );
-- Policies for Session Participants -- SESSION PARTICIPANTS
ALTER TABLE session_participants ENABLE ROW LEVEL SECURITY; ALTER TABLE session_participants ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can manage their own session participants" ON session_participants CREATE POLICY "session_participants_owner_policy" ON session_participants
FOR ALL USING (auth.uid() = user_id); FOR ALL USING (auth.uid() = user_id);
CREATE POLICY "Participants can see session membership" ON session_participants
FOR SELECT USING (
buddy_id IN (SELECT id FROM buddies WHERE buddy_profile_id = auth.uid())
);
-- Policies for Tasting Tags -- TASTING TAGS
ALTER TABLE tasting_tags ENABLE ROW LEVEL SECURITY; ALTER TABLE tasting_tags ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can manage their own tasting tags" ON tasting_tags CREATE POLICY "tasting_tags_owner_policy" ON tasting_tags
FOR ALL USING (auth.uid() = user_id); FOR ALL USING (auth.uid() = user_id);
CREATE POLICY "Tagged users can see the tags" ON tasting_tags
FOR SELECT USING (
buddy_id IN (SELECT id FROM buddies WHERE buddy_profile_id = auth.uid())
);
-- STORAGE SETUP -- STORAGE SETUP
-- Create 'bottles' bucket if it doesn't exist -- Create 'bottles' bucket if it doesn't exist