2020-10-05 17:07:35 +00:00
|
|
|
import Serializer from './application';
|
|
|
|
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/topology';
|
|
|
|
|
2020-11-09 17:29:12 +00:00
|
|
|
export default class TopologySerializer extends Serializer {
|
|
|
|
primaryKey = PRIMARY_KEY;
|
|
|
|
slugKey = SLUG_KEY;
|
|
|
|
|
|
|
|
respondForQueryRecord(respond, query) {
|
|
|
|
return super.respondForQueryRecord(function(cb) {
|
2020-10-05 17:07:35 +00:00
|
|
|
return respond(function(headers, body) {
|
|
|
|
return cb(headers, {
|
|
|
|
...body,
|
|
|
|
[SLUG_KEY]: query.id,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, query);
|
2020-11-09 17:29:12 +00:00
|
|
|
}
|
|
|
|
}
|