fix: query orders using admin client in admin routes to bypass RLS and show all orders to admin
All checks were successful
Staging Build / build (push) Successful in 3m24s

This commit is contained in:
DanielS
2026-06-25 23:30:29 +02:00
parent 45fb87d589
commit da7bd91b6f
3 changed files with 24 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { createClient } from '@/lib/supabase/server'
import { createAdminClient } from '@/lib/supabase/admin'
import { OrdersTable } from '@/components/admin/orders-table'
import { Suspense } from 'react'
@@ -20,9 +20,9 @@ export default async function AdminOrdersPage() {
}
async function OrdersData() {
const supabase = await createClient()
const adminDb = createAdminClient()
const { data: orders, error } = await supabase
const { data: orders, error } = await adminDb
.from('orders')
.select('*')
.order('created_at', { ascending: false })