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

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import { copy } from 'ember-copy';
     7  import ApplicationSerializer from './application';
     8  import classic from 'ember-classic-decorator';
     9  
    10  @classic
    11  export default class TokenSerializer extends ApplicationSerializer {
    12    primaryKey = 'AccessorID';
    13  
    14    attrs = {
    15      secret: 'SecretID',
    16    };
    17  
    18    normalize(typeHash, hash) {
    19      hash.PolicyIDs = hash.Policies;
    20      hash.PolicyNames = copy(hash.Policies);
    21      return super.normalize(typeHash, hash);
    22    }
    23  }