不要怂,就是干,撸起袖子干!

Commit 4886b866 by Simon Schick Committed by Sushant

fix(query-generator): fix bad property access (#10056)

1 parent a0545bf2
Showing with 10 additions and 13 deletions
...@@ -599,22 +599,19 @@ class QueryGenerator { ...@@ -599,22 +599,19 @@ class QueryGenerator {
const fieldsSql = options.fields.map(field => { const fieldsSql = options.fields.map(field => {
if (typeof field === 'string') { if (typeof field === 'string') {
return this.quoteIdentifier(field); return this.quoteIdentifier(field);
} else if (field._isSequelizeMethod) { }
if (field instanceof Utils.SequelizeMethod) {
return this.handleSequelizeMethod(field); return this.handleSequelizeMethod(field);
} else { }
let result = ''; if (field.attribute) {
field.name = field.attribute;
if (field.attribute) { }
field.name = field.attribute;
}
if (!field.name) {
throw new Error(`The following index field has no name: ${field}`);
}
result += this.quoteIdentifier(field.name); if (!field.name) {
return result; throw new Error(`The following index field has no name: ${field}`);
} }
return this.quoteIdentifier(field.name);
}); });
const fieldsSqlQuotedString = fieldsSql.join(', '); const fieldsSqlQuotedString = fieldsSql.join(', ');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!