Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Mar 23, 2024
1 parent 4722286 commit be8e096
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/api/bytes/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export async function POST(req: Request) {

const { commits } = body
await remove(commits.flatMap((c) => c.removed))
await Promise.all(
commits.flatMap((c) => [...c.added, ...c.modified]).map(upsert),
)

const bytes = commits.flatMap((c) => [...c.added, ...c.modified])
for await (const byte of bytes) {
await upsert(byte)
}

return NextResponse.json({ message: "ok" })
}

0 comments on commit be8e096

Please sign in to comment.