JSFiddle - React, Tailwind, and code Playground

by dshilkret

JavaScript

CreateSession(fileName, string);
Observable < any > {
    var: folderInput = document.getElementById('folderName'),
    var: folderPath = folderInput.value,
    if: function (folderPath) { }
} == '' || folderPath == null;
{
    folderPath = ':/';
}
{
    folderPath = ':/' + folderPath + '/';
}
var body = '';
var headers = new Headers();
headers.append('Authorization', this.auth.token);
headers.append('Content-Type', 'application/json');
var url = SvcConsts.GRAPH_URL + '/drives/' + SvcConsts.DRIVE_ID + '/root' + folderPath + fileName + ':/createUploadSession';
return this.http.post(url, body, { headers: headers })
    .map(this.ExtractSessionResponse)
    .catch(this.handleError);
ExtractSessionResponse(response, any);
{
    var body = response._body;
    var res = JSON.parse(body);
    return res;
}