Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export default function CreateGroup() {

await powerSync.writeTransaction(async (tx) => {
try {
await tx.executeAsync('INSERT INTO groups (id, owner_id, name, created_at) VALUES (?, ?, ?, datetime())', [
await tx.execute('INSERT INTO groups (id, owner_id, name, created_at) VALUES (?, ?, ?, datetime())', [
groupId,
user?.id,
name
]);
for (const profileId of selectedContacts) {
const membershipId = uuid();
await tx.executeAsync(
await tx.execute(
'INSERT INTO memberships (id, group_id, profile_id, created_at) VALUES (?, ?, ?, datetime())',
[membershipId, groupId, profileId]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@ export default function ContactsIndex() {
ownerId,
profileId
]);

/* await powerSync.writeTransaction(async (tx) => {
try {
tx.executeAsync(
"INSERT INTO profiles (id, name, handle, demo) VALUES (?, ?, ?, ?)",
[profileId, name, handle, true],
);
tx.executeAsync(
"INSERT INTO contacts (id, owner_id, profile_id) VALUES (?, ?, ?)",
[contactId, ownerId, profileId],
);
} catch (error) {
console.error("Error", error);
}
}); */
}

async function handleAddContact(profileId: string, name: string, handle: string) {
Expand Down