mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
ContactProperty and FilterCondition use reviveFromJson
This commit is contained in:
parent
9844c1882c
commit
2470f1add6
9 changed files with 78 additions and 75 deletions
|
|
@ -56,17 +56,15 @@ class FilterConditionModel extends AbstractModel {
|
|||
return true;
|
||||
}
|
||||
|
||||
parse(json) {
|
||||
if (json && json.Field && json.Type) {
|
||||
this.field(pString(json.Field));
|
||||
this.type(pString(json.Type));
|
||||
this.value(pString(json.Value));
|
||||
this.valueSecond(pString(json.ValueSecond));
|
||||
|
||||
return true;
|
||||
static reviveFromJson(json) {
|
||||
const filter = super.reviveFromJson(json);
|
||||
if (filter) {
|
||||
this.field(pString(json.field));
|
||||
this.type(pString(json.type));
|
||||
this.value(pString(json.value));
|
||||
this.valueSecond(pString(json.valueSecond));
|
||||
}
|
||||
|
||||
return false;
|
||||
return filter;
|
||||
}
|
||||
|
||||
toJson() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue