Skip to content

Commit 9362fbb

Browse files
committed
add requiredColumns
1 parent 49f7665 commit 9362fbb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Controllers/SchemaController.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ const defaultColumns: { [string]: SchemaFields } = Object.freeze({
151151
});
152152

153153
const requiredColumns = Object.freeze({
154+
_User: 'username',
154155
_Product: ['productIdentifier', 'icon', 'order', 'title', 'subtitle'],
155156
_Role: ['name', 'ACL'],
156157
});
@@ -1600,4 +1601,5 @@ export {
16001601
convertSchemaToAdapterSchema,
16011602
VolatileClassesSchemas,
16021603
SchemaController,
1604+
requiredColumns,
16031605
};

src/RestWrite.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var ClientSDK = require('./ClientSDK');
1515
import RestQuery from './RestQuery';
1616
import _ from 'lodash';
1717
import logger from './logger';
18+
import { requiredColumns } from './Controllers/SchemaController';
1819

1920
// query and data are both provided in REST API format. So data
2021
// types are encoded by plain old objects.
@@ -1665,14 +1666,11 @@ RestWrite.prototype._updateResponseWithData = function (response, data) {
16651666
this.storage.fieldsChangedByTrigger.push(key);
16661667
}
16671668
}
1668-
const defaultMandatoryColumnsInResponse = Object.freeze({
1669-
_User: ['username'],
1670-
});
16711669
const skipKeys = [
16721670
'objectId',
16731671
'createdAt',
16741672
'updatedAt',
1675-
...(defaultMandatoryColumnsInResponse[this.className] || []),
1673+
...(requiredColumns[this.className] || []),
16761674
];
16771675
for (const key in response) {
16781676
if (skipKeys.includes(key)) {

0 commit comments

Comments
 (0)