request to sketch working now

development
Thiemann96 5 years ago
parent 5c7373391d
commit 6d7c9bdece

@ -46,7 +46,7 @@ export class ConfigurationPage {
async uploadStandardSketch() { async uploadStandardSketch() {
const sketch = await this.loginProvider.getUserSketch(this.token,this.box._id,this.ssid,this.pw) const sketch = await this.loginProvider.getUserSketch(this.token,this.box._id,this.ssid,this.pw)
console.log(sketch); 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>{ async getUserSketch(token:string,id:string,ssid:string,password:string):Promise<string>{
let URL_sketch_final = URL_sketch+id+"/script"; let URL_sketch_final = URL_sketch+id+"/script";
console.log(URL_sketch_final) const headers = new HttpHeaders({'Authorization':"Bearer "+token})
const headers = new HttpHeaders({'Authorization':"Bearer "+token,responseType:'text'}) const params = new HttpParams({fromObject:{ssid,password}})
const params = new HttpParams({fromObject:{ const options = {
ssid, headers,
password params,
}}) 'responseType':'text'
return this.http.get(URL_sketch_final,{headers,params}) }
return this.http.get(URL_sketch_final,options)
.pipe(timeout(30000)) .pipe(timeout(30000))
.toPromise() .toPromise()
.catch(err=>{ .catch(err=>{

Loading…
Cancel
Save