mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 02:25:45 +08:00
fix(unpersistModel) Add default value for opts
param
Just an empty object, so looking up a property on it doesn't error. (Also some whitespace changes that automatically changed on save.)
This commit is contained in:
parent
5ed1f4da9e
commit
d3a0d60f0d
1 changed files with 3 additions and 3 deletions
|
@ -742,8 +742,8 @@ class DatabaseStore extends NylasStore {
|
|||
isIndexEmptyForAccount(accountId, modelKlass) {
|
||||
const modelTable = modelKlass.name
|
||||
const sql = (
|
||||
`SELECT \`${modelTable}\`.\`id\` FROM \`${modelTable}\` WHERE
|
||||
\`${modelTable}\`.is_search_indexed = 1 AND
|
||||
`SELECT \`${modelTable}\`.\`id\` FROM \`${modelTable}\` WHERE
|
||||
\`${modelTable}\`.is_search_indexed = 1 AND
|
||||
\`${modelTable}\`.\`account_id\` = ? LIMIT 1`
|
||||
);
|
||||
return this._query(sql, [accountId]).then(result => result.length === 0);
|
||||
|
@ -812,7 +812,7 @@ class DatabaseStore extends NylasStore {
|
|||
|
||||
// opts can have a boolean isBeingUnpersisted value, which when true prevents
|
||||
// this function from re-persisting the model.
|
||||
unindexModel(model, opts) {
|
||||
unindexModel(model, opts = {}) {
|
||||
const searchTableName = `${model.constructor.name}Search`;
|
||||
const sql = (
|
||||
`DELETE FROM \`${searchTableName}\` WHERE \`${searchTableName}\`.\`content_id\` = ?`
|
||||
|
|
Loading…
Reference in a new issue