@@ -62,14 +62,14 @@ export default (() => {
6262 return nowData ;
6363 } ,
6464 async getDeployments ( name : string ) : Promise < ZeitDeployment [ ] > {
65- const response = await axios . get < ZeitDeployment [ ] > (
65+ const response = await axios . get < { deployments : ZeitDeployment [ ] } > (
6666 'https://api.zeit.co/v4/now/deployments' ,
6767 {
6868 headers : getDefaultHeaders ( ) ,
6969 }
7070 ) ;
7171
72- const deploysNoAlias = response . data
72+ const deploysNoAlias = response . data . deployments
7373 . filter ( d => d . name === name )
7474 . sort ( ( a , b ) => ( a . created < b . created ? 1 : - 1 ) ) ;
7575
@@ -91,12 +91,16 @@ export default (() => {
9191 headers : getDefaultHeaders ( ) ,
9292 } ) ;
9393
94- return response . data ;
94+ return response . data . user ;
9595 } ,
96- async deleteDeployment ( id : string ) {
97- return axios . delete ( `https://api.zeit.co/v9/now/deployments/${ id } ` , {
98- headers : getDefaultHeaders ( ) ,
99- } ) ;
96+ async deleteDeployment ( id : string ) : Promise < ZeitDeployment [ ] > {
97+ const response = await axios . delete (
98+ `https://api.zeit.co/v9/now/deployments/${ id } ` ,
99+ {
100+ headers : getDefaultHeaders ( ) ,
101+ }
102+ ) ;
103+ return response . data . deployments ;
100104 } ,
101105 async deploy ( contents : any , sandbox : Sandbox ) : Promise < string > {
102106 const apiData = await getApiData ( contents , sandbox ) ;
@@ -110,7 +114,7 @@ export default (() => {
110114 }
111115 ) ;
112116
113- return `https://${ response . data . result . url } ` ;
117+ return `https://${ response . data . url } ` ;
114118 } ,
115119 async aliasDeployment ( id : string , zeitConfig : ZeitConfig ) : Promise < string > {
116120 const response = await axios . post (
@@ -121,7 +125,7 @@ export default (() => {
121125 }
122126 ) ;
123127
124- return `https://${ response . data . result . alias } ` ;
128+ return `https://${ response . data . alias } ` ;
125129 } ,
126130 } ;
127131} ) ( ) ;
0 commit comments