mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-17 01:36:57 +00:00
Fix mongo save new document/update document
This commit is contained in:
parent
45a64df0a2
commit
6b3df52185
@ -46,7 +46,6 @@ import { DocumentsTableComponent, DocumentsTableComponentItem } from "./Document
|
|||||||
|
|
||||||
export class DocumentsTabV2 extends TabsBase {
|
export class DocumentsTabV2 extends TabsBase {
|
||||||
public partitionKey: DataModels.PartitionKey;
|
public partitionKey: DataModels.PartitionKey;
|
||||||
|
|
||||||
private documentIds: DocumentId[];
|
private documentIds: DocumentId[];
|
||||||
private title: string;
|
private title: string;
|
||||||
|
|
||||||
@ -55,6 +54,7 @@ export class DocumentsTabV2 extends TabsBase {
|
|||||||
|
|
||||||
this.documentIds = options.documentIds();
|
this.documentIds = options.documentIds();
|
||||||
this.title = options.title;
|
this.title = options.title;
|
||||||
|
this.partitionKey = options.partitionKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
@ -1041,6 +1041,13 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mongo uses BSON format for _id, trying to parse it as JSON blocks normal flow in an edit
|
||||||
|
// Bypass validation for mongo
|
||||||
|
if (props.isPreferredApiMongoDB) {
|
||||||
|
onValidDocumentEdit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSON.parse(newContent);
|
JSON.parse(newContent);
|
||||||
onValidDocumentEdit();
|
onValidDocumentEdit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user