mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
Regression: Fixed OneDrive synchronisation (#3674)
This commit is contained in:
parent
f3cb903901
commit
39bffd2790
@ -327,22 +327,15 @@ class OneDriveApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async execAccountPropertiesRequest() {
|
async execAccountPropertiesRequest() {
|
||||||
const response = await shim.fetch('https://graph.microsoft.com/v1.0/me/drive', {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Authorization': this.token(),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.ok) {
|
try {
|
||||||
const text = await response.text();
|
const response = await this.exec('GET','https://graph.microsoft.com/v1.0/me/drive');
|
||||||
throw new Error(`Could not retrieve account details (drive ID, Account type): ${response.status}: ${response.statusText}: ${text}`);
|
|
||||||
} else {
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
const accountProperties = { accountType: data.driveType, driveId: data.id };
|
const accountProperties = { accountType: data.driveType, driveId: data.id };
|
||||||
return accountProperties;
|
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) {
|
async execJson(method, path, query, data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user