mirror of
https://github.com/marcogll/AnchorOS.git
synced 2026-03-15 13:24:27 +00:00
fix: use public supabase client for public endpoints
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server'
|
import { NextRequest, NextResponse } from 'next/server'
|
||||||
import { supabaseAdmin } from '@/lib/supabase/admin'
|
import { supabase } from '@/lib/supabase/client'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Retrieves all active locations
|
* @description Retrieves all active locations
|
||||||
*/
|
*/
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const { data: locations, error } = await supabaseAdmin
|
const { data: locations, error } = await supabase
|
||||||
.from('locations')
|
.from('locations')
|
||||||
.select('*')
|
.select('*')
|
||||||
.eq('is_active', true)
|
.eq('is_active', true)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server'
|
import { NextRequest, NextResponse } from 'next/server'
|
||||||
import { supabaseAdmin } from '@/lib/supabase/admin'
|
import { supabase } from '@/lib/supabase/client'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Retrieves active services, optionally filtered by location
|
* @description Retrieves active services, optionally filtered by location
|
||||||
@@ -9,7 +9,7 @@ export async function GET(request: NextRequest) {
|
|||||||
const { searchParams } = new URL(request.url)
|
const { searchParams } = new URL(request.url)
|
||||||
const locationId = searchParams.get('location_id')
|
const locationId = searchParams.get('location_id')
|
||||||
|
|
||||||
let query = supabaseAdmin
|
let query = supabase
|
||||||
.from('services')
|
.from('services')
|
||||||
.select('id, name, description, duration_minutes, base_price, requires_dual_artist, premium_fee_enabled, category, is_active, created_at, updated_at')
|
.select('id, name, description, duration_minutes, base_price, requires_dual_artist, premium_fee_enabled, category, is_active, created_at, updated_at')
|
||||||
.eq('is_active', true)
|
.eq('is_active', true)
|
||||||
|
|||||||
Reference in New Issue
Block a user