github.com/hernad/nomad@v1.6.112/ui/app/serializers/policy.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import ApplicationSerializer from './application';
     7  import classic from 'ember-classic-decorator';
     8  
     9  @classic
    10  export default class PolicySerializer extends ApplicationSerializer {
    11    primaryKey = 'Name';
    12  
    13    normalize(typeHash, hash) {
    14      hash.ID = hash.Name;
    15      return super.normalize(typeHash, hash);
    16    }
    17  
    18    serialize(snapshot, options) {
    19      const hash = super.serialize(snapshot, options);
    20      hash.ID = hash.Name;
    21      return hash;
    22    }
    23  }