request to sketch working now

development
Thiemann96 5 years ago
parent 5c7373391d
commit 6d7c9bdece

@ -46,7 +46,7 @@ export class ConfigurationPage {
async uploadStandardSketch() {
const sketch = await this.loginProvider.getUserSketch(this.token,this.box._id,this.ssid,this.pw)
console.log(sketch);
this.navCtrl.push(OtaWizardPage,{sketch})
this.navCtrl.push(OtaWizardPage,{sketch})
}

@ -58,13 +58,14 @@ export class LoginProvider {
async getUserSketch(token:string,id:string,ssid:string,password:string):Promise<string>{
let URL_sketch_final = URL_sketch+id+"/script";
console.log(URL_sketch_final)
const headers = new HttpHeaders({'Authorization':"Bearer "+token,responseType:'text'})
const params = new HttpParams({fromObject:{
ssid,
password
}})
return this.http.get(URL_sketch_final,{headers,params})
const headers = new HttpHeaders({'Authorization':"Bearer "+token})
const params = new HttpParams({fromObject:{ssid,password}})
const options = {
headers,
params,
'responseType':'text'
}
return this.http.get(URL_sketch_final,options)
.pipe(timeout(30000))
.toPromise()
.catch(err=>{

Loading…
Cancel
Save