Skip to content

Commit

Permalink
[D1] replace D1's dashed time-travel endpoints with underscored ones (#…
Browse files Browse the repository at this point in the history
…4841)

* [D1] replace D1's dashed time-travel endpoints with underscored ones

* [D1] make linter happy
  • Loading branch information
rozenmd authored Jan 26, 2024
1 parent b3c5566 commit 1039612
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/fifty-pigs-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

fix: replace D1's dashed time-travel endpoints with underscored ones

D1 will maintain its `d1/database/${databaseId}/time-travel/*` endpoints until GA, at which point older versions of wrangler will start throwing errors to users, asking them to upgrade their wrangler version to continue using Time Travel via CLI.
2 changes: 1 addition & 1 deletion packages/wrangler/src/d1/timeTravel/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const handleRestore = async (
searchParams: URLSearchParams
) => {
return await fetchResult<RestoreBookmarkResponse>(
`/accounts/${accountId}/d1/database/${databaseId}/time-travel/restore?${searchParams.toString()}`,
`/accounts/${accountId}/d1/database/${databaseId}/time_travel/restore?${searchParams.toString()}`,
{
headers: {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/d1/timeTravel/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const getBookmarkIdFromTimestamp = async (
}

const bookmarkResult = await fetchResult<BookmarkResponse>(
`/accounts/${accountId}/d1/database/${databaseId}/time-travel/bookmark?${searchParams.toString()}`,
`/accounts/${accountId}/d1/database/${databaseId}/time_travel/bookmark?${searchParams.toString()}`,
{
headers: {
"Content-Type": "application/json",
Expand Down

0 comments on commit 1039612

Please sign in to comment.