feat: add shared space support (#2486)

This commit is contained in:
Giacomo Cusinato
2024-09-06 10:29:31 +02:00
committed by GitHub
parent 2e78e96b75
commit c3adde5460
6 changed files with 29 additions and 6 deletions

View File

@@ -509,11 +509,19 @@ export class CreateApi {
private async headers(): Promise<Record<string, string>> {
const token = await this.token();
return {
const headers: Record<string, string> = {
'content-type': 'application/json',
accept: 'application/json',
authorization: `Bearer ${token}`,
};
const sharedSpaceID =
this.arduinoPreferences['arduino.cloud.sharedSpaceID'];
if (sharedSpaceID) {
headers['x-organization'] = sharedSpaceID;
}
return headers;
}
private domain(apiVersion = 'v2'): string {