We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a15e807 commit a303486Copy full SHA for a303486
app/serializers/session.js
@@ -0,0 +1,18 @@
1
+import ApplicationSerializer from 'open-event-frontend/serializers/application';
2
+import CustomPrimaryKeyMixin from 'open-event-frontend/mixins/custom-primary-key';
3
+
4
+export default ApplicationSerializer.extend(CustomPrimaryKeyMixin, {
5
6
+ serialize() {
7
+ const json = this._super(...arguments);
8
9
+ const { attributes } = json.data;
10
+ if (Object.keys(attributes['complex-field-values']).length === 0) {
11
+ // If object is empty, remove it so that validations on server aren't triggered
12
+ delete attributes['complex-field-values'];
13
+ }
14
15
+ return json;
16
17
18
+});
0 commit comments