chore: bump version to 2.23.2 and enhance team account creation (#440)
* chore: bump version to 2.23.2 and enhance team account creation - Updated application version from 2.23.1 to 2.23.2 in package.json. - Enhanced team account creation to support slugs for non-Latin names, including validation and UI updates. - Updated localization files to reflect new slug requirements and error messages. - Refactored related schemas and server actions to accommodate slug handling in team account creation and updates. * refactor: remove old trigger and function for adding current user to new account - Dropped the trigger "add_current_user_to_new_account" and the associated function from the database schema. - Updated permissions for the function public.create_team_account to ensure proper access control.
This commit is contained in:
committed by
GitHub
parent
e1bfbc8106
commit
0636f8cf11
@@ -7,15 +7,15 @@ select no_plan();
|
||||
select tests.create_supabase_user('update_test_owner', 'update-owner@test.com');
|
||||
select tests.create_supabase_user('update_test_member', 'update-member@test.com');
|
||||
|
||||
-- Authenticate as owner to create team account
|
||||
select makerkit.authenticate_as('update_test_owner');
|
||||
-- Create team account using service_role and create_team_account function
|
||||
-- DON'T authenticate first - the add_current_user_to_new_account trigger
|
||||
-- would also create a membership if auth.uid() = primary_owner_user_id
|
||||
-- The function already creates the membership, so we avoid duplicate by keeping auth.uid() NULL
|
||||
set local role service_role;
|
||||
|
||||
-- Create a team account (owner is added automatically via trigger)
|
||||
insert into public.accounts (name, is_personal_account)
|
||||
values ('Update Test Team', false);
|
||||
select public.create_team_account('Update Test Team', tests.get_supabase_uid('update_test_owner'));
|
||||
|
||||
-- Add member to the team with 'member' role using service_role
|
||||
set role service_role;
|
||||
-- Add member to the team with 'member' role (still in service_role)
|
||||
|
||||
insert into public.accounts_memberships (account_id, user_id, account_role)
|
||||
values (
|
||||
|
||||
Reference in New Issue
Block a user