27bb03bbc0
* adding copyright header * fix fmt and a test
49 lines
1 KiB
JavaScript
49 lines
1 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
export const storeMVP = {
|
|
serializerFor() {
|
|
return {
|
|
serializeIntoHash() {},
|
|
};
|
|
},
|
|
};
|
|
|
|
export default function (modelName) {
|
|
return [
|
|
{
|
|
adapterMethod: 'findRecord',
|
|
args: [null, { modelName }, 'foo'],
|
|
url: `/v1/${modelName}/id/foo`,
|
|
method: 'GET',
|
|
},
|
|
|
|
{
|
|
adapterMethod: 'createRecord',
|
|
args: [storeMVP, { modelName }],
|
|
url: `/v1/${modelName}`,
|
|
method: 'POST',
|
|
},
|
|
{
|
|
adapterMethod: 'updateRecord',
|
|
args: [storeMVP, { modelName }, { id: 'foo', modelName }],
|
|
url: `/v1/${modelName}/id/foo`,
|
|
method: 'PUT',
|
|
},
|
|
{
|
|
adapterMethod: 'deleteRecord',
|
|
args: [storeMVP, { modelName }, { id: 'foo', modelName }],
|
|
url: `/v1/${modelName}/id/foo`,
|
|
method: 'DELETE',
|
|
},
|
|
{
|
|
adapterMethod: 'query',
|
|
args: [null, { modelName }, {}],
|
|
url: `/v1/${modelName}/id?list=true`,
|
|
method: 'GET',
|
|
},
|
|
];
|
|
}
|