From bddc8a7b5d7115d1211fd12d7f5544d503e0bb20 Mon Sep 17 00:00:00 2001 From: Kevin Schiffer Date: Sun, 18 Jun 2023 12:13:48 +0200 Subject: [PATCH] dev: Send body as search parameters for delete requests --- CHANGELOG.md | 1 + cypress/integration/console/devices/unclaim.spec.js | 12 ++++++++---- sdk/js/src/api/http.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 202c0cf6520..46e02cd1eed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ For details about compatibility between different releases, see the **Commitment ### Fixed - Console not applying webhook field masks when creating a webhook from a template that has field masks set. +- Removing user invitations not working in the user management panel for administrators. ### Security diff --git a/cypress/integration/console/devices/unclaim.spec.js b/cypress/integration/console/devices/unclaim.spec.js index 49791b715b7..c9ac0cba552 100644 --- a/cypress/integration/console/devices/unclaim.spec.js +++ b/cypress/integration/console/devices/unclaim.spec.js @@ -86,10 +86,14 @@ describe('Device un-claiming', () => { cy.findByRole('button', { name: /Unclaim and delete end device/ }).click() }) - cy.wait('@unclaim-request').its('request.body').should('deep.equal', { - dev_eui: ns.end_device.ids.dev_eui, - join_eui: '0000000000000000', - }) + cy.wait('@unclaim-request') + .its('request.url') + .then(url => { + const params = new URLSearchParams(new URL(url).search) + + expect(params.get('dev_eui')).to.equal(ns.end_device.ids.dev_eui) + expect(params.get('join_eui')).to.equal('0000000000000000') + }) cy.findByTestId('error-notification').should('not.exist') diff --git a/sdk/js/src/api/http.js b/sdk/js/src/api/http.js index cc29c17fdc0..d4df5501bf7 100644 --- a/sdk/js/src/api/http.js +++ b/sdk/js/src/api/http.js @@ -108,7 +108,7 @@ class Http { url: endpoint, } - if (method === 'get') { + if (method === 'get' || method === 'delete') { // For GETs convert payload to query params (should usually // be field_mask only). config.params = this._payloadToQueryParams(payload)