* chore: 🤖 Upgrade API layer to ember 4.12 * chore: 🤖 Upgrade ember-data to 4.12 * fix: 🐛 Fix breaking change from usage of internal method * chore: 🤖 Remove stylelint in API addon * test: 💍 Fix broken API tests * chore: 🤖 get rid of toArray * test: 💍 Fix tests broken by ember data changes --------- Co-authored-by: dharini <dharini@hashicorp.com>
This commit is contained in:
1 parent
77b47e2cb3
commit
0e9042f588
21 files changed
+1338
-284
No files matched your search
@@ -20,8 +20,12 @@ export default class HostCatalogAdapter extends ApplicationAdapter {
|
||||
buildURL(modelName, id, snapshot, requestType) {
|
||||
let url = super.buildURL(...arguments);
|
||||
if (requestType === 'createRecord') {
|
||||
const pluginName = snapshot.attr('plugin')?.name;
|
||||
if (pluginName) url = `${url}?plugin_name=${pluginName}`;
|
||||
try {
|
||||
const pluginName = snapshot.attr('plugin')?.name;
|
||||
if (pluginName) url = `${url}?plugin_name=${pluginName}`;
|
||||
} catch (e) {
|
||||
// Ignore any adapter errors here
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,12 @@ export default class SessionRecordingAdapter extends ApplicationAdapter {
|
||||
*/
|
||||
buildURL(modelName, id, snapshot, requestType, query) {
|
||||
let url = super.buildURL(...arguments);
|
||||
const method = snapshot?.adapterOptions?.method;
|
||||
let method;
|
||||
try {
|
||||
method = snapshot?.adapterOptions?.method;
|
||||
} catch (e) {
|
||||
// Ignore any adapter errors here
|
||||
}
|
||||
if (method === 'download') {
|
||||
const queryParams = new URLSearchParams(query).toString();
|
||||
if (queryParams) url = `${url}?${queryParams}`;
|
||||
|
||||
@@ -19,7 +19,12 @@ export default class StorageBucketAdapter extends ApplicationAdapter {
|
||||
*/
|
||||
buildURL(modelName, id, snapshot, requestType) {
|
||||
let url = super.buildURL(...arguments);
|
||||
const pluginName = snapshot?.attr('plugin')?.name;
|
||||
let pluginName;
|
||||
try {
|
||||
pluginName = snapshot?.attr('plugin')?.name;
|
||||
} catch (e) {
|
||||
// Ignore any adapter errors here
|
||||
}
|
||||
if (requestType === 'createRecord' && pluginName) {
|
||||
url = `${url}?plugin_name=${pluginName}`;
|
||||
}
|
||||
|
||||
@@ -209,9 +209,9 @@ export default class ApplicationSerializer extends RESTSerializer {
|
||||
* @return {object}
|
||||
*/
|
||||
normalizeMissingArrays(store, primaryModelClass, payload) {
|
||||
const attrDefs = store._attributesDefinitionFor(
|
||||
primaryModelClass.modelName
|
||||
);
|
||||
const attrDefs = store
|
||||
.getSchemaDefinitionService()
|
||||
.attributesDefinitionFor({ type: primaryModelClass.modelName });
|
||||
if (attrDefs) {
|
||||
Object.keys(attrDefs).forEach((key) => {
|
||||
if (!payload[key] && attrDefs[key]?.options?.emptyArrayIfMissing) {
|
||||
|
||||
Reference in new issue
Block a user