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

Delete with data not working since v0.20.0 #3318

Closed
MBurchard opened this issue Oct 6, 2020 · 3 comments
Closed

Delete with data not working since v0.20.0 #3318

MBurchard opened this issue Oct 6, 2020 · 3 comments

Comments

@MBurchard
Copy link

Describe the bug

DELETE Request with data stopped working when installing v0.20.0.
The data is not send any more.
Switching back to v0.19.2 solved the problem.

To Reproduce

Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question

import axios from 'axios';

const http = axios.create({
	baseURL: '/api',
	timeout: 60000
});

const getAppHeader = (app) => {
	return {
		headers: {
			'X-ON-BEHALF-OF-APPLICATION': app.clientId
		}
	};
};

/**
 * Adds Users to the Application Manager Group for the given application.
 *
 * @param users
 * @param app
 * @return {Promise<boolean>}
 */
const changeAppMgrGroupMembers = async (app, users) => {
	const conf = getAppHeader(app);
	const usersRemove = [];
	const usersAdd = [];
	users.forEach((user) => {
		if (user.flagDelete) {
			usersRemove.push(user);
		} else {
			usersAdd.push(user);
		}
	});
	let result = true;
	try {
		const response = await http.delete('/AppMgrGroups', Object.assign({data: usersRemove}, conf));
		result = response.status === 202;
	} catch (e) {
		console.error('Error in addUsersToAppMgrGroup', e);
	}
	...

Expected behavior

Delete with data should continue working in v0.20. Much better would be, if it works same as post or push.

Environment

  • Axios Version [e.g. 0.20.0]
  • Adapter [e.g. XHR/HTTP]
  • Browser Firefox
  • Browser Version 81
  • Node.js Version 12.18.4
  • OS: Linux Mint 20
  • Additional Library Versions @vue/cli 4.5.6, vue 2
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2020

Hello! 👋

This issue is being automatically closed because it does not follow the issue template. Please read the issue template carefully and follow all of the instructions when opening a new issue.

Thanks

@github-actions github-actions bot closed this as completed Oct 6, 2020
@jmsv
Copy link

jmsv commented Oct 11, 2020

Same issue here, looks like it's been fixed in #3282 but not released yet

@jasonsaayman
Copy link
Member

Hi,

Version 0.21.0 has been released 🎉 please use that and let us know if that solves your issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants