27bb03bbc0
* adding copyright header * fix fmt and a test
24 lines
464 B
JavaScript
24 lines
464 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import ApplicationSerializer from '../application';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
primaryKey: 'name',
|
|
|
|
extractLazyPaginatedData(payload) {
|
|
return payload.data.keys.map((key) => {
|
|
const model = {
|
|
id: key,
|
|
name: key,
|
|
};
|
|
if (payload.backend) {
|
|
model.backend = payload.backend;
|
|
}
|
|
return model;
|
|
});
|
|
},
|
|
});
|