diff --git a/addons/api/addon/serializers/host-set.js b/addons/api/addon/serializers/host-set.js index b90c607bc..19994f7da 100644 --- a/addons/api/addon/serializers/host-set.js +++ b/addons/api/addon/serializers/host-set.js @@ -80,8 +80,8 @@ export default class HostSetSerializer extends ApplicationSerializer { */ normalize(typeClass, hash, ...rest) { const normalizedHash = copy(hash, true); - if (typeof normalizedHash?.filters === 'string') { - normalizedHash.filters = [normalizedHash.filters]; + if (typeof normalizedHash?.attributes?.filters === 'string') { + normalizedHash.attributes.filters = [normalizedHash.attributes.filters]; } const normalized = super.normalize(typeClass, normalizedHash, ...rest); return normalized; diff --git a/addons/api/mirage/factories/host-set.js b/addons/api/mirage/factories/host-set.js index d805d0feb..4a45a5da5 100644 --- a/addons/api/mirage/factories/host-set.js +++ b/addons/api/mirage/factories/host-set.js @@ -35,21 +35,24 @@ export default factory.extend({ return faker.datatype.number(); } }, - // AWS specific - filters() { + + attributes() { + // AWS specific if (this.plugin?.name === 'aws') { const filtersAmount = faker.datatype.number({ min: 1, max: 5 }); - let result = []; + let filters = []; for (let i = 0; i < filtersAmount; ++i) { - result.push(`${faker.datatype.string(3)}=${faker.datatype.string(8)}`); + filters.push(`${faker.datatype.string(3)}=${faker.datatype.string(8)}`); } - return result; + return { + filters, + }; } - }, - // Azure specific - filter() { + // Azure specific if (this.plugin?.name === 'azure') { - return `${faker.database.column()}=${faker.database.collation()}`; + return { + filter: `${faker.database.column()}=${faker.database.collation()}`, + }; } }, });