Files
nomad/ui/app/adapters/volume.js
Phil Renaud 76e39b1c1e [ui] Volumes and plugins navigation fixes, generally (#24542)
* Volumes and plugins navigation fixes, generally

* Mirage no longer has to take the csi/ string into account

* Volume adapter test fix
2024-11-29 16:14:17 -05:00

24 lines
712 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import WatchableNamespaceIDs from './watchable-namespace-ids';
import classic from 'ember-classic-decorator';
@classic
export default class VolumeAdapter extends WatchableNamespaceIDs {
// Over in serializers/volume.js, we prepend csi/ as part of the hash ID for request resolution reasons.
// However, this is not part of the actual ID stored in the database and we should treat it like a regular, unescaped
// path segment.
urlForFindRecord() {
let url = super.urlForFindRecord(...arguments);
return url.replace('csi%2F', 'csi/');
}
queryParamsToAttrs = {
type: 'type',
plugin_id: 'plugin.id',
};
}