Skip to content

Commit b3a136b

Browse files
committed
rename
1 parent 519beae commit b3a136b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Controllers/SchemaController.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,15 @@ const defaultColumns: { [string]: SchemaFields } = Object.freeze({
150150
},
151151
});
152152

153-
const requiredColumns = Object.freeze({
154-
_User: ['username'],
153+
const requiredColumnsForWrite = Object.freeze({
155154
_Product: ['productIdentifier', 'icon', 'order', 'title', 'subtitle'],
156155
_Role: ['name', 'ACL'],
157156
});
158157

158+
const requiredColumnsForRead = Object.freeze({
159+
_User: ['username'],
160+
});
161+
159162
const invalidColumns = ['length'];
160163

161164
const systemClasses = Object.freeze([
@@ -1270,7 +1273,7 @@ export default class SchemaController {
12701273

12711274
// Validates that all the properties are set for the object
12721275
validateRequiredColumns(className: string, object: any, query: any) {
1273-
const columns = requiredColumns[className];
1276+
const columns = requiredColumnsForWrite[className];
12741277
if (!columns || columns.length == 0) {
12751278
return Promise.resolve(this);
12761279
}
@@ -1601,5 +1604,5 @@ export {
16011604
convertSchemaToAdapterSchema,
16021605
VolatileClassesSchemas,
16031606
SchemaController,
1604-
requiredColumns,
1607+
requiredColumnsForRead,
16051608
};

src/RestWrite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +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';
18+
import { requiredColumnsForRead } from './Controllers/SchemaController';
1919

2020
// query and data are both provided in REST API format. So data
2121
// types are encoded by plain old objects.
@@ -1670,7 +1670,7 @@ RestWrite.prototype._updateResponseWithData = function (response, data) {
16701670
'objectId',
16711671
'createdAt',
16721672
'updatedAt',
1673-
...(requiredColumns[this.className] || []),
1673+
...(requiredColumnsForRead[this.className] || []),
16741674
];
16751675
for (const key in response) {
16761676
if (skipKeys.includes(key)) {

0 commit comments

Comments
 (0)