Skip to content

Commit 8e7abe1

Browse files
committed
refactor reset-wind-history endpoint to streamline deletion process
1 parent 3606e0e commit 8e7abe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ router.delete("/reset-wind-history", authMiddleware, async (ctx) => {
278278
const stations = kv.list<StationStats>({
279279
prefix: ["station"],
280280
});
281-
const transaction = kv.atomic();
282281
for await (const entry of entries) {
283-
transaction.delete(entry.key);
282+
kv.delete(entry.key);
284283
}
284+
const transaction = kv.atomic();
285285
for await (const station of stations) {
286286
transaction.set(["station", station.value.id], {
287287
...station.value,

0 commit comments

Comments
 (0)