From 94d3d6d3efa525f31b1c519067cce9f88fb8490b Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Fri, 6 May 2022 19:54:34 +0100 Subject: [PATCH] Fix deployment endpoint for wrangler pages publish (#917) --- .changeset/sour-lies-whisper.md | 5 +++++ packages/wrangler/src/__tests__/pages.test.ts | 2 +- packages/wrangler/src/pages.tsx | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/sour-lies-whisper.md diff --git a/.changeset/sour-lies-whisper.md b/.changeset/sour-lies-whisper.md new file mode 100644 index 000000000000..15f33c2bfff3 --- /dev/null +++ b/.changeset/sour-lies-whisper.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +fix: Hit correct endpoint for 'wrangler pages publish' diff --git a/packages/wrangler/src/__tests__/pages.test.ts b/packages/wrangler/src/__tests__/pages.test.ts index 24987fdea192..b74afb72aa2b 100644 --- a/packages/wrangler/src/__tests__/pages.test.ts +++ b/packages/wrangler/src/__tests__/pages.test.ts @@ -297,7 +297,7 @@ describe("pages", () => { ); setMockResponse( - "/accounts/:accountId/pages/projects/foo/deployment", + "/accounts/:accountId/pages/projects/foo/deployments", async ([_url, accountId], init) => { expect(accountId).toEqual("some-account-id"); expect(init.method).toEqual("POST"); diff --git a/packages/wrangler/src/pages.tsx b/packages/wrangler/src/pages.tsx index 8bdeebdea140..78ca45bfde63 100644 --- a/packages/wrangler/src/pages.tsx +++ b/packages/wrangler/src/pages.tsx @@ -1216,7 +1216,7 @@ const createDeployment: CommandModule< } const deploymentResponse = await fetchResult( - `/accounts/${accountId}/pages/projects/${projectName}/deployment`, + `/accounts/${accountId}/pages/projects/${projectName}/deployments`, { method: "POST", body: formData,