Skip to content

Commit 002c553

Browse files
committed
fix: handle slug changes by using record id
1 parent bb6b9a2 commit 002c553

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

background/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ class AirtableSyncWorker {
6464
}
6565

6666
await prisma.satellite.upsert({
67-
where: { slug },
67+
where: { recordId: record.id },
6868
update: {
69-
recordId: record.id,
69+
slug,
7070
data,
7171
active: websiteActive,
7272
updatedAt: new Date(),
@@ -84,8 +84,8 @@ class AirtableSyncWorker {
8484

8585
const inactiveCount = await prisma.satellite.updateMany({
8686
where: {
87-
slug: {
88-
notIn: records.map(r => r.get('slug') as string).filter(Boolean),
87+
recordId: {
88+
notIn: records.map(r => r.id),
8989
},
9090
active: true,
9191
},

0 commit comments

Comments
 (0)