Files
HKSingleParty/99_references/supabase-examples/caching/with-react-query-nextjs-14/queries/get-country-by-id.ts
2025-05-28 09:55:51 +08:00

16 lines
288 B
TypeScript

import { TypedSupabaseClient } from '@/utils/types'
export function getCountryById(client: TypedSupabaseClient, countryId: number) {
return client
.from('countries')
.select(
`
id,
name
`
)
.eq('id', countryId)
.throwOnError()
.single()
}