open-nomad/ui/app/serializers/task-group.js
2019-04-10 14:54:35 -07:00

16 lines
410 B
JavaScript

import { copy } from 'ember-copy';
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
normalize(typeHash, hash) {
// Provide EphemeralDisk to each task
hash.Tasks.forEach(task => {
task.EphemeralDisk = copy(hash.EphemeralDisk);
});
hash.ReservedEphemeralDisk = hash.EphemeralDisk.SizeMB;
return this._super(typeHash, hash);
},
});