fix: typo in auth-sql-rules-examples.js (#22831)

* fix: typo in auth-sql-rules-examples.js

* fix: get code sample running

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
This commit is contained in:
George MoonandCharis authored and GitHub committed 2024-04-19 16:55:59 -04:00
1 parent 6ccd9243db
commit b38af4a5fc
1 file changed
+11 -12
@@ -59,26 +59,25 @@ using ( (select auth.uid()) = id );
url: '/docs/guides/auth#policies-with-joins',
code: `
create table teams (
id serial primary key,
id bigint primary key generated always as identity,
name text
);
create table members (
team_id references team.id,
user_id referenced auth.users.id
team_id bigint references teams,
user_id uuid references auth.users
);
alter table teams enable row level security;
-- Create Advanced Policies
create policy "Team members can update team details"
on teams
for update using (
(select auth.uid()) in (
select user_id from members
where team_id = id
)
);
create policy "Team members can update team details if they belong to the team"
on teams
for update using (
(select auth.uid()) in (
select user_id from members
where team_id = id
)
);
`.trim(),
},
]