質問編集履歴
3
ソース部修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,23 +12,23 @@
|
|
12
12
|
|
13
13
|
get orderTypes(): Promise<OrderEntity['orderType'][]> {
|
14
14
|
|
15
|
-
return n
|
15
|
+
return (async () => (await this.orders).map(({ orderType }) => orderType)()
|
16
16
|
|
17
|
-
|
17
|
+
.then((orderTypes => {
|
18
18
|
|
19
|
-
console.log("@@"+JSON.stringfy(a));
|
20
|
-
|
21
|
-
|
19
|
+
return orderTypes.sort(sortOrder);
|
22
|
-
|
23
|
-
resolve(list);
|
24
20
|
|
25
21
|
});
|
22
|
+
|
23
|
+
|
26
24
|
|
27
25
|
}
|
28
26
|
|
29
27
|
|
30
28
|
|
31
29
|
export const sortOrder = (a: any, b: any) => {
|
30
|
+
|
31
|
+
console.log(a);
|
32
32
|
|
33
33
|
return a.id > b.id ? 1 : -1;
|
34
34
|
|
2
ソース部修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
export const
|
31
|
+
export const sortOrder = (a: any, b: any) => {
|
32
32
|
|
33
33
|
return a.id > b.id ? 1 : -1;
|
34
34
|
|
1
ソース部修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
console.log("@@"+JSON.stringfy(a));
|
20
20
|
|
21
|
-
list.sort(
|
21
|
+
list.sort(sortOrder);
|
22
22
|
|
23
23
|
resolve(list);
|
24
24
|
|
@@ -28,6 +28,16 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
+
export const = sortOrder = (a: any, b: any) => {
|
32
|
+
|
33
|
+
return a.id > b.id ? 1 : -1;
|
34
|
+
|
35
|
+
};
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
31
41
|
```
|
32
42
|
|
33
43
|
ログで出力したら、listの中身はobject Promiseと表示されているので格納はされていると思うのですが、、
|