diff --git a/backend/resources/hacknight.py b/backend/resources/hacknight.py index f3d25d1f..3a532876 100644 --- a/backend/resources/hacknight.py +++ b/backend/resources/hacknight.py @@ -91,13 +91,13 @@ def delete(self, id): hacknight = Hacknight.query.get_or_404(id) participants = {participant.id for participant in hacknight.participants} json_data = request.get_json(force=True) - ids_schema = Schema.from_dict({"participant_ids": fields.List(fields.Int())}) + ids_schema = Schema.from_dict({"participants_ids": fields.List(fields.Int())}) try: data = ids_schema().load(json_data) except ValidationError as err: return err.messages, HTTPStatus.UNPROCESSABLE_ENTITY - to_remove = participants.intersection(set(data["participant_ids"])) + to_remove = participants.intersection(set(data["participants_ids"])) if not to_remove: return {"message": "No participant to delete"}, HTTPStatus.BAD_REQUEST hacknight.participants = [ diff --git a/frontend/src/store/modules/hacknight.js b/frontend/src/store/modules/hacknight.js index c7471d1e..9684d838 100644 --- a/frontend/src/store/modules/hacknight.js +++ b/frontend/src/store/modules/hacknight.js @@ -77,11 +77,11 @@ export default { commit('raiseError', error); }); }, - deleteParticipants({ commit, getters }, participant_ids) { + deleteParticipants({ commit, getters }, participants_ids) { axios .delete(`/api/hacknights/${getters.getHacknight.id}/participants/`, { data: { - participant_ids: participant_ids + participants_ids: participants_ids } }) .then(res => {