Browse Source

added initListDbo

tags/v0.1.5
Robin Thoni 8 years ago
parent
commit
b0673ec218
1 changed files with 10 additions and 4 deletions
  1. 10
    4
      src/Business/lu-webapi-crud-business.js

+ 10
- 4
src/Business/lu-webapi-crud-business.js View File

@@ -45,15 +45,21 @@
45 45
                     return Business.extendDeep({}, Business.defaultDbo, dbo);
46 46
                 };
47 47
 
48
+                Business.initListDbo = function(list)
49
+                {
50
+                    var d = [];
51
+                    for (var i = 0; i < list.length; ++i) {
52
+                        d.push(Business.initDbo(list[i]));
53
+                    }
54
+                    return d;
55
+                };
56
+
48 57
                 Business.initPaginatedDbo = function(data)
49 58
                 {
50 59
                     var d = {
51 60
                         count: data.count,
52
-                        data: []
61
+                        data: Business.initListDbo(data.data)
53 62
                     };
54
-                    for (var i = 0; i < data.data.length; ++i) {
55
-                        d.data.push(Business.initDbo(data.data[i]));
56
-                    }
57 63
                     return d;
58 64
                 };
59 65
 

Loading…
Cancel
Save