Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not including detail id in wrangler output from R2 event notifications #6671

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smooth-bananas-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: Update R2 Create Event Notification response
7 changes: 3 additions & 4 deletions packages/wrangler/src/r2/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ export async function getEventNotificationConfig(

/** Construct & transmit notification configuration to EWC.
*
* On success, receive HTTP 200 response with a body like:
* { event_notification_detail_id: string }
* On success, receive HTTP 200 response with no body
*
* Possible status codes on failure:
* - 400 Bad Request - Either:
Expand All @@ -506,7 +505,7 @@ export async function putEventNotificationConfig(
eventTypes: R2EventType[],
prefix?: string,
suffix?: string
): Promise<{ event_notification_detail_id: string }> {
): Promise<void> {
const queue = await getQueue(config, queueName);
const headers = eventNotificationHeaders(apiCredentials);
let actions: R2EventableOperation[] = [];
Expand All @@ -526,7 +525,7 @@ export async function putEventNotificationConfig(
" and "
)} (${actions.join(",")})`
);
return await fetchResult<{ event_notification_detail_id: string }>(
return await fetchResult<void>(
`/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
{ method: "PUT", body: JSON.stringify(body), headers }
);
Expand Down
Loading