Skip to content

Commit 37c580b

Browse files
committed
fix: Update Supabase RPC call to handle result data correctly
1 parent 4489e0c commit 37c580b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/durable-objects/supabase-do.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ export class SupabaseDO extends DurableObject<Env> {
4747
private async fetchStats(): Promise<StatsResponse | undefined> {
4848
try {
4949
const { data, error } = await this.supabase
50-
.rpc('get_stats')
51-
.returns<StatsResponse>()
52-
.single();
50+
.rpc('get_stats', undefined, {
51+
count: 'exact'
52+
})
53+
.select('*')
54+
.maybeSingle();
5355

5456
if (error) {
5557
console.error('Error fetching stats:', error);

0 commit comments

Comments
 (0)