File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ class ApiService {
22
22
this . client = client
23
23
}
24
24
25
- get ( path : string ) : Promise < Array < Object >> {
25
+ get ( path : string ) : Promise < Object > | Promise < Array < Object >> {
26
26
return this . client . get ( path ) . then ( response => response . data )
27
27
}
28
28
29
29
post ( path : string , payload : Object ) : Promise < Object > {
30
30
return this . client . post ( path , payload ) . then ( response => response . data )
31
31
}
32
32
33
- patch ( path : string , payload : Object ) {
33
+ patch ( path : string , payload : Object ) : Promise < Object > {
34
34
return this . client . patch ( path , payload ) . then ( response => response . data )
35
35
}
36
36
Original file line number Diff line number Diff line change 1
1
// @flow
2
2
3
- import type { Posts , Post } from '../types/posts'
3
+ import type { Post , Posts } from '../types/posts'
4
4
5
5
import service from './Api'
6
6
7
- export function fetchPostsFromApi ( ) : Promise < Posts > {
7
+ export function fetchPostsFromApi ( ) : Promise < Post > | Promise < Posts > {
8
8
return service . get ( '/posts' )
9
9
}
10
10
You can’t perform that action at this time.
0 commit comments