2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
*/
|
|
|
|
|
|
2022-07-28 14:57:53 -04:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
|
|
|
|
|
|
export default ApplicationSerializer.extend({
|
|
|
|
|
modelName: 'worker',
|
2024-07-12 13:31:42 -05:00
|
|
|
|
|
|
|
|
_hashForModel(model) {
|
|
|
|
|
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
|
|
|
|
this,
|
|
|
|
|
arguments,
|
|
|
|
|
);
|
|
|
|
|
if (json.api_tags) {
|
|
|
|
|
const keys = Object.keys(model.api_tags);
|
|
|
|
|
keys.forEach((key) => {
|
|
|
|
|
if (json.api_tags[key]?.length === 0) {
|
|
|
|
|
delete json.api_tags[key];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return json;
|
|
|
|
|
},
|
2022-07-28 14:57:53 -04:00
|
|
|
});
|