Skip to content

Commit 16c68b9

Browse files
committed
rename
1 parent 52fa70a commit 16c68b9

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

spec/CloudCode.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,15 +1598,15 @@ describe('Cloud Code', () => {
15981598
expect(obj.get('count')).toBe(0);
15991599
});
16001600

1601-
it('Pointer should not be cleared by triggers', async () => {
1601+
it('pointer should not be cleared by triggers', async () => {
16021602
Parse.Cloud.afterSave('MyObject', () => {});
16031603
const foo = await new Parse.Object('Test', { foo: 'bar' }).save();
16041604
const obj = await new Parse.Object('MyObject', { foo }).save();
16051605
const foo2 = obj.get('foo');
16061606
expect(foo2.get('foo')).toBe('bar');
16071607
});
16081608

1609-
it('Can set a pointer in triggers', async () => {
1609+
it('can set a pointer in triggers', async () => {
16101610
Parse.Cloud.beforeSave('MyObject', () => {});
16111611
Parse.Cloud.afterSave(
16121612
'MyObject',

src/Controllers/SchemaController.js

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

153-
const requiredColumnsForWrite = Object.freeze({
154-
_Product: ['productIdentifier', 'icon', 'order', 'title', 'subtitle'],
155-
_Role: ['name', 'ACL'],
153+
const requiredColumns = Object.freeze({
154+
read: {
155+
_User: ['username'],
156+
},
157+
write: {
158+
_Product: ['productIdentifier', 'icon', 'order', 'title', 'subtitle'],
159+
_Role: ['name', 'ACL'],
160+
}
156161
});
157162

158-
const requiredColumnsForRead = Object.freeze({
159-
_User: ['username'],
160-
});
161163

162164
const invalidColumns = ['length'];
163165

@@ -1273,7 +1275,7 @@ export default class SchemaController {
12731275

12741276
// Validates that all the properties are set for the object
12751277
validateRequiredColumns(className: string, object: any, query: any) {
1276-
const columns = requiredColumnsForWrite[className];
1278+
const columns = requiredColumns.write[className];
12771279
if (!columns || columns.length == 0) {
12781280
return Promise.resolve(this);
12791281
}
@@ -1604,5 +1606,5 @@ export {
16041606
convertSchemaToAdapterSchema,
16051607
VolatileClassesSchemas,
16061608
SchemaController,
1607-
requiredColumnsForRead,
1609+
requiredColumns,
16081610
};

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 { requiredColumnsForRead } from './Controllers/SchemaController';
18+
import { requiredColumns } 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-
...(requiredColumnsForRead[this.className] || []),
1673+
...(requiredColumns.read[this.className] || []),
16741674
];
16751675
for (const key in response) {
16761676
if (skipKeys.includes(key)) {

0 commit comments

Comments
 (0)