* refactor: 💡 add global settings link ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12257 * fix: 🐛 route ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12257 * fix: 🐛 comment ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12257 * feat: 🎸 add reapply sp to session recording page * fix: 🐛 normalize * feat: 🎸 upates * fix: 🐛 logs * fix: 🐛 comment * test: 💍 add tests * fix: 🐛 normalizer, style * fix: 🐛 normalize * fix: 🐛 normalizw * fix: 🐛 normalize * test: 💍 add tests for serializer n normalizer * fix: 🐛 name * fix: 🐛 do not delete, send null * fix: 🐛 return --------- Co-authored-by: Lisbet Alvarez <lisbet.alvarez@hashicorp.com>
28 lines
804 B
JavaScript
28 lines
804 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import ApplicationSerializer from './application';
|
|
import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
|
|
|
|
export default class ConnectionSerializer extends ApplicationSerializer.extend(
|
|
EmbeddedRecordsMixin,
|
|
) {
|
|
attrs = {
|
|
channel_recordings: { embedded: 'always' },
|
|
};
|
|
|
|
normalize(typeClass, hash, ...rest) {
|
|
const normalizedHash = structuredClone(hash);
|
|
const err = normalizedHash.errors;
|
|
delete normalizedHash.errors;
|
|
const normalized = super.normalize(typeClass, normalizedHash, ...rest);
|
|
// we should not override the ember models errors field,
|
|
// so we rename the errors field from the api
|
|
normalized.data.attributes.errors_number = err;
|
|
|
|
return normalized;
|
|
}
|
|
}
|