mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
27 lines
666 B
JavaScript
27 lines
666 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import ApplicationSerializer from './application';
|
|
import { arrToObj } from '../utils';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
embed: true,
|
|
include: ['deploymentTaskGroupSummaries'],
|
|
|
|
serialize() {
|
|
var json = ApplicationSerializer.prototype.serialize.apply(this, arguments);
|
|
if (json instanceof Array) {
|
|
json.forEach(serializeDeployment);
|
|
} else {
|
|
serializeDeployment(json);
|
|
}
|
|
return json;
|
|
},
|
|
});
|
|
|
|
function serializeDeployment(deployment) {
|
|
deployment.TaskGroups = deployment.DeploymentTaskGroupSummaries.reduce(arrToObj('Name'), {});
|
|
}
|