1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Regression: Fixed OneDrive synchronisation (#3674)

This commit is contained in:
jonath92 2020-08-28 10:46:41 +02:00 committed by GitHub
parent f3cb903901
commit 39bffd2790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -327,22 +327,15 @@ class OneDriveApi {
}
async execAccountPropertiesRequest() {
const response = await shim.fetch('https://graph.microsoft.com/v1.0/me/drive', {
method: 'GET',
headers: {
'Authorization': this.token(),
},
});
if (!response.ok) {
const text = await response.text();
throw new Error(`Could not retrieve account details (drive ID, Account type): ${response.status}: ${response.statusText}: ${text}`);
} else {
try {
const response = await this.exec('GET','https://graph.microsoft.com/v1.0/me/drive');
const data = await response.json();
const accountProperties = { accountType: data.driveType, driveId: data.id };
return accountProperties;
} catch (error) {
throw new Error(`Could not retrieve account details (drive ID, Account type. Error code: ${error.code}, Error message: ${error.message}`);
}
}
async execJson(method, path, query, data) {