mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Update the underlying node model when toggling eligibility in mirage
This commit is contained in:
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user