open-nomad/ui/app/serializers/policy.js
Phil Renaud ce0ffdd077
[ui] Policies UI (#13976)
Co-authored-by: Mike Nomitch <mail@mikenomitch.com>
2022-12-06 12:45:36 -05:00

19 lines
440 B
JavaScript

import ApplicationSerializer from './application';
import classic from 'ember-classic-decorator';
@classic
export default class PolicySerializer extends ApplicationSerializer {
primaryKey = 'Name';
normalize(typeHash, hash) {
hash.ID = hash.Name;
return super.normalize(typeHash, hash);
}
serialize(snapshot, options) {
const hash = super.serialize(snapshot, options);
hash.ID = hash.Name;
return hash;
}
}