e9219a1ae0
* Failing test and TODO for wildcard * Alias the namespace query parameter for Evals * eval: fix list when using ACLs and * namespace Apply the same verification process as in job, allocs and scaling policy list endpoints to handle the eval list when using an ACL token with limited namespace support but querying using the `*` wildcard namespace. * changelog: add entry for #13530 * ui: set namespace when querying eval Evals have a unique UUID as ID, but when querying them the Nomad API still expects a namespace query param, otherwise it assumes `default`. Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
23 lines
683 B
JavaScript
23 lines
683 B
JavaScript
import ApplicationAdapter from './application';
|
|
import classic from 'ember-classic-decorator';
|
|
|
|
@classic
|
|
export default class EvaluationAdapter extends ApplicationAdapter {
|
|
handleResponse(_status, headers) {
|
|
const result = super.handleResponse(...arguments);
|
|
result.meta = { nextToken: headers['x-nomad-nexttoken'] };
|
|
return result;
|
|
}
|
|
|
|
urlForFindRecord(_id, _modelName, snapshot) {
|
|
const namespace = snapshot.attr('namespace') || 'default';
|
|
const baseURL = super.urlForFindRecord(...arguments);
|
|
const url = `${baseURL}?namespace=${namespace}`;
|
|
|
|
if (snapshot.adapterOptions?.related) {
|
|
return `${url}&related=true`;
|
|
}
|
|
return url;
|
|
}
|
|
}
|