mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 23:16:56 +00:00
Change schema endpoints (#447)
* fix resource bug (id is a method) * change schema endpoints * fix test Co-authored-by: REDMOND\gaausfel <gaausfel@microsoft.com>
This commit is contained in:
parent
8629bcbe2d
commit
864d9393f2
@ -69,11 +69,13 @@ describe("Add Schema", () => {
|
||||
subscriptionId: userContext.subscriptionId,
|
||||
resourceGroup: userContext.resourceGroup,
|
||||
accountName: userContext.databaseAccount.name,
|
||||
resource: `dbs/${database.id}/colls/${collection.id}`,
|
||||
resource: `dbs/${database.id()}/colls/${collection.id}`,
|
||||
status: "new",
|
||||
});
|
||||
expect(checkForSchema).not.toBeNull();
|
||||
expect(database.junoClient.getSchema).toBeCalledWith(
|
||||
userContext.subscriptionId,
|
||||
userContext.resourceGroup,
|
||||
userContext.databaseAccount.name,
|
||||
database.id(),
|
||||
collection.id
|
||||
|
@ -329,11 +329,13 @@ export default class Database implements ViewModels.Database {
|
||||
subscriptionId: userContext.subscriptionId,
|
||||
resourceGroup: userContext.resourceGroup,
|
||||
accountName: userContext.databaseAccount.name,
|
||||
resource: `dbs/${this.id}/colls/${collection.id}`,
|
||||
resource: `dbs/${this.id()}/colls/${collection.id}`,
|
||||
status: "new",
|
||||
});
|
||||
checkForSchema = setInterval(async () => {
|
||||
const response: IJunoResponse<DataModels.ISchema> = await this.junoClient.getSchema(
|
||||
userContext.subscriptionId,
|
||||
userContext.resourceGroup,
|
||||
userContext.databaseAccount.name,
|
||||
this.id(),
|
||||
collection.id
|
||||
|
@ -427,7 +427,7 @@ export class JunoClient {
|
||||
public async requestSchema(
|
||||
schemaRequest: DataModels.ISchemaRequest
|
||||
): Promise<IJunoResponse<DataModels.ISchemaRequest>> {
|
||||
const response = await window.fetch(`${this.getAnalyticsUrl()}/${schemaRequest.accountName}/schema/request`, {
|
||||
const response = await window.fetch(`${this.getAnalyticsUrl()}/schema/request`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(schemaRequest),
|
||||
headers: JunoClient.getHeaders(),
|
||||
@ -445,12 +445,14 @@ export class JunoClient {
|
||||
}
|
||||
|
||||
public async getSchema(
|
||||
subscriptionId: string,
|
||||
resourceGroup: string,
|
||||
accountName: string,
|
||||
databaseName: string,
|
||||
containerName: string
|
||||
): Promise<IJunoResponse<DataModels.ISchema>> {
|
||||
const response = await window.fetch(
|
||||
`${this.getAnalyticsUrl()}/${accountName}/schema/${databaseName}/${containerName}`,
|
||||
`${this.getAnalyticsUrl()}/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/databaseAccounts/${accountName}/schema/${databaseName}/${containerName}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: JunoClient.getHeaders(),
|
||||
|
Loading…
Reference in New Issue
Block a user