Skip to content

Commit

Permalink
Updates notification-hubs deleteRegistration so that it actually HTTP…
Browse files Browse the repository at this point in the history
… DELETEs. (#25910)

According to the docs, the delete API expects a `HTTP DELETE
/registrations/<registrationId>`, but the got uses `HTTP GET`, hence
delete does not work.


https://learn.microsoft.com/en-us/rest/api/notificationhubs/delete-registration
<img width="699" alt="Screenshot 2023-05-17 at 22 49 27"
src="https://github.com/Azure/azure-sdk-for-js/assets/86589079/2a4687da-0cc7-4d0b-a758-370ae017ad05">


### Packages impacted by this PR
https://www.npmjs.com/package/@azure/notification-hubs

### Issues associated with this PR
N/A

### Describe the problem that is addressed by this PR
According to the docs, the delete API expects a `HTTP DELETE
/registrations/<registrationId>`, but the got uses `HTTP GET`, hence
delete does not work.


https://learn.microsoft.com/en-us/rest/api/notificationhubs/delete-registration

### Checklists
- [x] Added impacted package name to the issue description? Yes
- [x] Does this PR needs any fixes in the SDK Generator?**  No
- [x] Added a changelog: Not necessary
  • Loading branch information
anastasios-captureone authored May 18, 2023
1 parent 0afa40a commit cf0a0f8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function deleteRegistration(
headers.set("Content-Type", "application/atom+xml;type=entry;charset=utf-8");
headers.set("If-Match", isDefined(options.etag) ? `"${options.etag}"` : "*");

const request = createRequest(endpoint, "GET", headers, updatedOptions);
const request = createRequest(endpoint, "DELETE", headers, updatedOptions);
const response = await sendRequest(context, request, 200);

return parseNotificationResponse(response);
Expand Down

0 comments on commit cf0a0f8

Please sign in to comment.