Skip to content

Commit 1acf0cd

Browse files
committed
fix: use .schema('private').rpc() instead of dot-notation in contacts-client
1 parent 931316b commit 1acf0cd

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

supabase/functions/export-contacts/contacts-client.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@ export class ContactsClient {
88

99
async getContacts(userId: string, ids?: string[]): Promise<Contact[]> {
1010
if (ids && ids.length > 0) {
11-
const { data, error } = await this.supabase.rpc(
12-
"private.get_contacts_table_by_ids",
13-
{ p_user_id: userId, p_ids: ids },
14-
);
11+
const { data, error } = await this.supabase
12+
.schema("private")
13+
.rpc("get_contacts_table_by_ids", {
14+
p_user_id: userId,
15+
p_ids: ids,
16+
});
1517
if (error) {
1618
throw new Error(`Failed to fetch contacts: ${error.message}`);
1719
}
1820
return (data || []) as unknown as Contact[];
1921
}
2022

21-
const { data, error } = await this.supabase.rpc("private.get_contacts_table", {
22-
p_user_id: userId,
23-
});
23+
const { data, error } = await this.supabase
24+
.schema("private")
25+
.rpc("get_contacts_table", {
26+
p_user_id: userId,
27+
});
2428
if (error) {
2529
throw new Error(`Failed to fetch contacts: ${error.message}`);
2630
}

0 commit comments

Comments
 (0)