mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 18:01:39 +00:00
Add all arm request related files to Matser (#373)
* “minor changes” * 'changes for unit test'
This commit is contained in:
@@ -30,7 +30,7 @@ export class ARMError extends Error {
|
||||
Object.setPrototypeOf(this, ARMError.prototype);
|
||||
}
|
||||
|
||||
public code: string | number;
|
||||
public code?: string | number;
|
||||
}
|
||||
|
||||
interface ARMQueryParams {
|
||||
@@ -63,6 +63,10 @@ export async function armRequest<T>({
|
||||
queryParams.metricNames && url.searchParams.append("metricnames", queryParams.metricNames);
|
||||
}
|
||||
|
||||
if (!userContext.authorizationToken) {
|
||||
throw new Error("No authority token provided");
|
||||
}
|
||||
|
||||
const response = await window.fetch(url.href, {
|
||||
method,
|
||||
headers: {
|
||||
@@ -98,6 +102,10 @@ export async function armRequest<T>({
|
||||
}
|
||||
|
||||
async function getOperationStatus(operationStatusUrl: string) {
|
||||
if (!userContext.authorizationToken) {
|
||||
throw new Error("No authority token provided");
|
||||
}
|
||||
|
||||
const response = await window.fetch(operationStatusUrl, {
|
||||
headers: {
|
||||
Authorization: userContext.authorizationToken
|
||||
|
||||
Reference in New Issue
Block a user