Skip to content

Commit

Permalink
refactor reset-wind-history endpoint to streamline deletion process
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescorpian committed Mar 4, 2025
1 parent 3606e0e commit 8e7abe1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ router.delete("/reset-wind-history", authMiddleware, async (ctx) => {
const stations = kv.list<StationStats>({
prefix: ["station"],
});
const transaction = kv.atomic();
for await (const entry of entries) {
transaction.delete(entry.key);
kv.delete(entry.key);
}
const transaction = kv.atomic();
for await (const station of stations) {
transaction.set(["station", station.value.id], {
...station.value,
Expand Down

0 comments on commit 8e7abe1

Please sign in to comment.