1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Resolves #918: Skip properties that are on sync target but not handled by local client

This commit is contained in:
Laurent Cozic
2018-10-31 00:35:57 +00:00
parent 990591cc80
commit e41896d6f3
3 changed files with 34 additions and 7 deletions

View File

@ -92,6 +92,16 @@ class BaseModel {
return this.db().tableFields(this.tableName());
}
static removeUnknownFields(model) {
const newModel = {};
for (let n in model) {
if (!model.hasOwnProperty(n)) continue;
if (!this.hasField(n) && n !== 'type_') continue;
newModel[n] = model[n];
}
return newModel;
}
static new() {
let fields = this.fields();
let output = {};