github.com/hernad/nomad@v1.6.112/ui/app/adapters/evaluation.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import ApplicationAdapter from './application';
     7  import classic from 'ember-classic-decorator';
     8  
     9  @classic
    10  export default class EvaluationAdapter extends ApplicationAdapter {
    11    handleResponse(_status, headers) {
    12      const result = super.handleResponse(...arguments);
    13      result.meta = { nextToken: headers['x-nomad-nexttoken'] };
    14      return result;
    15    }
    16  
    17    urlForFindRecord(_id, _modelName, snapshot) {
    18      const namespace = snapshot.attr('namespace') || 'default';
    19      const baseURL = super.urlForFindRecord(...arguments);
    20      const url = `${baseURL}?namespace=${namespace}`;
    21  
    22      if (snapshot.adapterOptions?.related) {
    23        return `${url}&related=true`;
    24      }
    25      return url;
    26    }
    27  }