Refactor billing service and enhance account APIs
This commit includes renaming and refactoring of some billing services for clarification and coherence. It also improves account APIs in team-accounts and accounts packages by having added `getAccount` and `getTeamAccount` methods, allowing retrieval of account details via slug and id. Changes also include type modifications in `getSupabaseServerActionClient` function for better flexibility and precision.
This commit is contained in:
@@ -14,14 +14,16 @@ import { getSupabaseClientKeys } from '../get-supabase-client-keys';
|
||||
const keys = getSupabaseClientKeys();
|
||||
const serviceRoleKey = getServiceRoleKey();
|
||||
|
||||
function createServerSupabaseClient() {
|
||||
return createServerClient<Database>(keys.url, keys.anonKey, {
|
||||
function createServerSupabaseClient<
|
||||
GenericSchema extends Database = Database,
|
||||
>() {
|
||||
return createServerClient<GenericSchema>(keys.url, keys.anonKey, {
|
||||
cookies: getCookiesStrategy(),
|
||||
});
|
||||
}
|
||||
|
||||
export function getSupabaseServerActionClient<
|
||||
GenericSchema = Database,
|
||||
GenericSchema extends Database = Database,
|
||||
>(params?: { admin: boolean }) {
|
||||
const keys = getSupabaseClientKeys();
|
||||
const admin = params?.admin ?? false;
|
||||
|
||||
Reference in New Issue
Block a user