refactor: generate and use Supabase TypeScript types

Co-authored-by: Moheeb Zara <1184415+virgilvox@users.noreply.github.com>
This commit is contained in:
v0
2026-03-11 08:12:39 +00:00
co-authored by Moheeb Zara
parent c34d5d9529
commit 2e136b5f55
18 changed files with 1135 additions and 342 deletions
+4 -1
View File
@@ -3,6 +3,8 @@
import { createClient } from '@/lib/supabase/server'
import { redirect } from 'next/navigation'
import { revalidatePath } from 'next/cache'
import type { SupabaseClient } from '@supabase/supabase-js'
import type { Database } from '@/types/database'
// ─── Auth ────────────────────────────────────────────────────────────────────
@@ -26,7 +28,7 @@ export async function getUser() {
}
// ─── Helper: get current member (any non-inactive status) ────────────────────
async function getMember(supabase: any, userId: string) {
async function getMember(supabase: SupabaseClient<Database>, userId: string) {
const { data } = await supabase
.from('space_members')
.select('space_id, role, display_name')
@@ -670,6 +672,7 @@ export async function createSecret(formData: {
const { data, error } = await supabase.from('secrets').insert({
space_id: member.space_id,
title: formData.title,
label: formData.title,
value: formData.value,
description: formData.description,
area: formData.area,