Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobbias Nan committed Aug 21, 2019
1 parent 0bade56 commit 62b9f11
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Controllers/SchemaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const volatileClasses = Object.freeze([
const userIdRegex = /^[a-zA-Z0-9]{10}$/;
// Anything that start with role
const roleRegex = /^role:.*/;
// Anything that start with readUserFields
// Anything that starts with readUserFields
const pointerPermissionRegex = /^readUserFields:.*/;
// * permission
const publicRegex = /^\*$/;
Expand Down Expand Up @@ -908,10 +908,15 @@ export default class SchemaController {
let defaultValueType = getType(fieldType.defaultValue);
if (typeof defaultValueType === 'string') {
defaultValueType = { type: defaultValueType };
} else if (typeof defaultValueType === 'object' && fieldType.type === 'Relation') {
} else if (
typeof defaultValueType === 'object' &&
fieldType.type === 'Relation'
) {
return {
code: Parse.Error.INCORRECT_TYPE,
error: `The 'default value' option is not applicable for ${typeToString(fieldType)}`
error: `The 'default value' option is not applicable for ${typeToString(
fieldType
)}`,
};
}
if (!dbTypeMatchesObjectType(fieldType, defaultValueType)) {
Expand All @@ -926,7 +931,9 @@ export default class SchemaController {
if (typeof fieldType === 'object' && fieldType.type === 'Relation') {
return {
code: Parse.Error.INCORRECT_TYPE,
error: `The 'required' option is not applicable for ${typeToString(fieldType)}`
error: `The 'required' option is not applicable for ${typeToString(
fieldType
)}`,
};
}
}
Expand Down

0 comments on commit 62b9f11

Please sign in to comment.