Enable API related tests for Postgres (#2970)
This commit is contained in:
committed by
Florent Vilmart
parent
edf6ab6875
commit
78646a3e91
@@ -136,6 +136,20 @@ const handleDotFields = (object) => {
|
||||
return object;
|
||||
}
|
||||
|
||||
const validateKeys = (object) => {
|
||||
if (typeof object == 'object') {
|
||||
for (const key in object) {
|
||||
if (typeof object[key] == 'object') {
|
||||
validateKeys(object[key]);
|
||||
}
|
||||
|
||||
if(key.includes('$') || key.includes('.')){
|
||||
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the list of join tables on a schema
|
||||
const joinTablesForSchema = (schema) => {
|
||||
let list = [];
|
||||
@@ -649,6 +663,8 @@ export class PostgresStorageAdapter {
|
||||
|
||||
object = handleDotFields(object);
|
||||
|
||||
validateKeys(object);
|
||||
|
||||
Object.keys(object).forEach(fieldName => {
|
||||
var authDataMatch = fieldName.match(/^_auth_data_([a-zA-Z0-9_]+)$/);
|
||||
if (authDataMatch) {
|
||||
|
||||
Reference in New Issue
Block a user