mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
merge all Model JSON @Object parsers into a reviveFromJson()
This commit is contained in:
parent
76648f04ae
commit
15e07a73e9
18 changed files with 378 additions and 411 deletions
|
|
@ -468,7 +468,7 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
|
||||
/**
|
||||
* @param {string} sResult
|
||||
* @param {AjaxJsonDefaultResponse} oData
|
||||
* @param {FetchJsonDefaultResponse} oData
|
||||
*/
|
||||
deleteResponse(sResult, oData) {
|
||||
if (500 < (StorageResultType.Success === sResult && oData && oData.Time ? pInt(oData.Time) : 0)) {
|
||||
|
|
@ -570,13 +570,11 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
|
||||
if (StorageResultType.Success === result && data && data.Result && data.Result.List) {
|
||||
if (Array.isNotEmpty(data.Result.List)) {
|
||||
list = data.Result.List.map(item => {
|
||||
const contact = new ContactModel();
|
||||
return contact.parse(item) ? contact : null;
|
||||
data.Result.List.forEach(item => {
|
||||
item = ContactModel.reviveFromJson(item);
|
||||
item && list.push(item);
|
||||
});
|
||||
|
||||
list = list.filter(v => v);
|
||||
|
||||
count = pInt(data.Result.Count);
|
||||
count = 0 < count ? count : 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue