mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-26 15:37:02 +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 {
|
||||
public partitionKey: DataModels.PartitionKey;
|
||||
|
||||
private documentIds: DocumentId[];
|
||||
private title: string;
|
||||
|
||||
@ -55,6 +54,7 @@ export class DocumentsTabV2 extends TabsBase {
|
||||
|
||||
this.documentIds = options.documentIds();
|
||||
this.title = options.title;
|
||||
this.partitionKey = options.partitionKey;
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
@ -1041,6 +1041,13 @@ const DocumentsTabComponent: React.FunctionComponent<{
|
||||
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 {
|
||||
JSON.parse(newContent);
|
||||
onValidDocumentEdit();
|
||||
|
Loading…
Reference in New Issue
Block a user