File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -153,11 +153,11 @@ export function Teams (http, data) {
153153 * client.organization('organizationUid').teams().fetchAll()
154154 * .then((response) => console.log(response))
155155 */
156- this . fetchAll = fetchAll ( http , TeamsCollection )
156+ this . fetchAll = fetchAll ( http , TeamsCollection , { api_version : 1.1 } )
157157 }
158158}
159159export function TeamsCollection ( http , teamsData ) {
160- const obj = cloneDeep ( teamsData ) || [ ]
160+ const obj = cloneDeep ( teamsData . teams ) || [ ]
161161 const teamsCollection = obj . map ( ( team ) => {
162162 return new Teams ( http , team )
163163 } )
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ export function testTeams (organization: Organization) {
77 test ( 'should fetch all the teams' , done => {
88 organization . teams ( ) . fetchAll ( )
99 . then ( ( teams ) => {
10- expect ( teams [ 0 ] . organizationUid ) . not . to . be . equal ( undefined )
11- expect ( teams [ 0 ] . name ) . not . to . be . equal ( null )
12- expect ( teams [ 0 ] . created_by ) . not . to . be . equal ( null )
13- expect ( teams [ 0 ] . updated_by ) . not . to . be . equal ( null )
10+ expect ( teams . items [ 0 ] . organizationUid ) . not . to . be . equal ( undefined )
11+ expect ( teams . items [ 0 ] . name ) . not . to . be . equal ( null )
12+ expect ( teams . items [ 0 ] . created_by ) . not . to . be . equal ( null )
13+ expect ( teams . items [ 0 ] . updated_by ) . not . to . be . equal ( null )
1414 done ( )
1515 } )
1616 . catch ( done )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export interface Team extends TeamData {
1515}
1616
1717export interface Teams extends Creatable < Team , TeamData > {
18- fetchAll ( params ?: AnyProperty ) : Promise < ContentstackCollection < Teams > >
18+ fetchAll ( params ?: AnyProperty ) : Promise < ContentstackCollection < Team > >
1919}
2020
2121export interface TeamData extends AnyProperty {
You can’t perform that action at this time.
0 commit comments