mirror of
https://github.com/sensebox/blockly-app
synced 2025-07-01 08:30:26 +02:00
request to sketch working now
This commit is contained in:
parent
5c7373391d
commit
6d7c9bdece
2 changed files with 9 additions and 8 deletions
|
@ -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…
Add table
Reference in a new issue