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
All checks were successful
Staging Build / build (push) Successful in 3m24s
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user