From 44904ba3f117d06a5e5c73d4e4529f608efb4275 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Sat, 2 Nov 2019 00:54:37 -0700 Subject: [PATCH] Update the underlying node model when toggling eligibility in mirage --- ui/mirage/config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/mirage/config.js b/ui/mirage/config.js index 6814ab4d8..5ca13aecb 100644 --- a/ui/mirage/config.js +++ b/ui/mirage/config.js @@ -207,8 +207,12 @@ export default function() { return this.serialize(allocations.where({ nodeId: params.id })); }); - this.post('/node/:id/eligibility', function({ nodes }, { params }) { - return this.serialize(nodes.find({ id: params.id })); + this.post('/node/:id/eligibility', function({ nodes }, { params, requestBody }) { + const body = JSON.parse(requestBody); + const node = nodes.find({ id: params.id }); + + node.update({ schedulingEligibility: body.Elibility === 'eligible' }); + return this.serialize(node); }); this.post('/node/:id/drain', function({ nodes }, { params }) {