Skip to content

Commit 931316b

Browse files
committed
fix: use upsert and private schema prefix in export-contacts RPC calls
1 parent 56f5cc7 commit 931316b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class ContactsClient {
99
async getContacts(userId: string, ids?: string[]): Promise<Contact[]> {
1010
if (ids && ids.length > 0) {
1111
const { data, error } = await this.supabase.rpc(
12-
"get_contacts_table_by_ids",
12+
"private.get_contacts_table_by_ids",
1313
{ p_user_id: userId, p_ids: ids },
1414
);
1515
if (error) {
@@ -18,7 +18,7 @@ export class ContactsClient {
1818
return (data || []) as unknown as Contact[];
1919
}
2020

21-
const { data, error } = await this.supabase.rpc("get_contacts_table", {
21+
const { data, error } = await this.supabase.rpc("private.get_contacts_table", {
2222
p_user_id: userId,
2323
});
2424
if (error) {
@@ -97,7 +97,7 @@ export class ContactsClient {
9797
const { error } = await this.supabase
9898
.schema("private")
9999
.from("engagement")
100-
.insert(values, { ignoreDuplicates: true });
100+
.upsert(values);
101101

102102
if (error) {
103103
throw new Error(

0 commit comments

Comments
 (0)