github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/serializers/policy.js (about)

     1  import ApplicationSerializer from './application';
     2  import classic from 'ember-classic-decorator';
     3  
     4  @classic
     5  export default class PolicySerializer extends ApplicationSerializer {
     6    primaryKey = 'Name';
     7  
     8    normalize(typeHash, hash) {
     9      hash.ID = hash.Name;
    10      return super.normalize(typeHash, hash);
    11    }
    12  
    13    serialize(snapshot, options) {
    14      const hash = super.serialize(snapshot, options);
    15      hash.ID = hash.Name;
    16      return hash;
    17    }
    18  }