mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 02:53:45 +00:00
fix(#56): Address PR comments
This commit is contained in:
@@ -93,7 +93,7 @@ class CatchRecordRepository {
|
|||||||
const { data: result, error } = await this.supabase
|
const { data: result, error } = await this.supabase
|
||||||
.from('catch_records')
|
.from('catch_records')
|
||||||
.upsert(dbRows, {
|
.upsert(dbRows, {
|
||||||
onConflict: 'userId,pokedexId,pokedexEntryId'
|
onConflict: '"userId","pokedexId","pokedexEntryId"'
|
||||||
})
|
})
|
||||||
.select();
|
.select();
|
||||||
|
|
||||||
|
|||||||
@@ -196,6 +196,14 @@ CREATE POLICY "Users can update own catch records" ON public.catch_records
|
|||||||
WHERE public.pokedexes.id = public.catch_records."pokedexId"
|
WHERE public.pokedexes.id = public.catch_records."pokedexId"
|
||||||
AND public.pokedexes."userId" = auth.uid()
|
AND public.pokedexes."userId" = auth.uid()
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
WITH CHECK (
|
||||||
|
auth.uid() = new."userId" AND
|
||||||
|
EXISTS (
|
||||||
|
SELECT 1 FROM public.pokedexes
|
||||||
|
WHERE public.pokedexes.id = new."pokedexId"
|
||||||
|
AND public.pokedexes."userId" = auth.uid()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE POLICY "Users can delete own catch records" ON public.catch_records
|
CREATE POLICY "Users can delete own catch records" ON public.catch_records
|
||||||
|
|||||||
Reference in New Issue
Block a user