mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Basic JSON object properties revival now handled by AbstractModel
This will be better for future use of JSON.stringify() and JSON.parse() For now the difference between the PHP JSON being PascalCase and the JS object properties being camelCase is handled by AbstractModel
This commit is contained in:
parent
53bf7c1d60
commit
188a40b196
17 changed files with 131 additions and 185 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { FilterConditionField, FilterConditionType } from 'Common/Enums';
|
||||
import { pString } from 'Common/Utils';
|
||||
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
||||
|
|
@ -56,16 +55,7 @@ class FilterConditionModel extends AbstractModel {
|
|||
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 filter;
|
||||
}
|
||||
// static reviveFromJson(json) {}
|
||||
|
||||
toJson() {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue