mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Fix enable synapse link error (#918)
* Fix enable synapse error * Default all ARM requests to JSON Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
parent
b65456f754
commit
ee4404c439
@ -29,7 +29,13 @@ export async function update(
|
||||
body: Types.DatabaseAccountUpdateParameters
|
||||
): Promise<Types.DatabaseAccountGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`;
|
||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PATCH", apiVersion, body });
|
||||
return armRequest({
|
||||
host: configContext.ARM_ENDPOINT,
|
||||
path,
|
||||
method: "PATCH",
|
||||
apiVersion,
|
||||
body,
|
||||
});
|
||||
}
|
||||
|
||||
/* Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. */
|
||||
|
@ -6,6 +6,7 @@ Instead, generate ARM clients that consume this function with stricter typing.
|
||||
*/
|
||||
|
||||
import promiseRetry, { AbortError } from "p-retry";
|
||||
import { HttpHeaders } from "../../Common/Constants";
|
||||
import { configContext } from "../../ConfigContext";
|
||||
import { userContext } from "../../UserContext";
|
||||
|
||||
@ -45,6 +46,7 @@ interface Options {
|
||||
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";
|
||||
body?: unknown;
|
||||
queryParams?: ARMQueryParams;
|
||||
contentType?: string;
|
||||
}
|
||||
|
||||
export async function armRequestWithoutPolling<T>({
|
||||
@ -54,6 +56,7 @@ export async function armRequestWithoutPolling<T>({
|
||||
method,
|
||||
body: requestBody,
|
||||
queryParams,
|
||||
contentType,
|
||||
}: Options): Promise<{ result: T; operationStatusUrl: string }> {
|
||||
const url = new URL(path, host);
|
||||
url.searchParams.append("api-version", configContext.armAPIVersion || apiVersion);
|
||||
@ -70,6 +73,7 @@ export async function armRequestWithoutPolling<T>({
|
||||
method,
|
||||
headers: {
|
||||
Authorization: userContext.authorizationToken,
|
||||
[HttpHeaders.contentType]: contentType || "application/json",
|
||||
},
|
||||
body: requestBody ? JSON.stringify(requestBody) : undefined,
|
||||
});
|
||||
@ -104,6 +108,7 @@ export async function armRequest<T>({
|
||||
method,
|
||||
body: requestBody,
|
||||
queryParams,
|
||||
contentType,
|
||||
}: Options): Promise<T> {
|
||||
const armRequestResult = await armRequestWithoutPolling<T>({
|
||||
host,
|
||||
@ -112,6 +117,7 @@ export async function armRequest<T>({
|
||||
method,
|
||||
body: requestBody,
|
||||
queryParams,
|
||||
contentType,
|
||||
});
|
||||
const operationStatusUrl = armRequestResult.operationStatusUrl;
|
||||
if (operationStatusUrl) {
|
||||
|
Loading…
Reference in New Issue
Block a user