mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-04 07:24:52 +01:00
* Fixes issue where empty partition key is treated like nonexistent key for Tables API * Updated format * Refactor fix * Prettier * Fixes issue when CRUD with no parition key for all APIs * Format fix * Refactor to explicitly check for Tables
13 lines
394 B
TypeScript
13 lines
394 B
TypeScript
import { userContext } from "UserContext";
|
|
import DocumentId from "../../Explorer/Tree/DocumentId";
|
|
|
|
export const getPartitionKeyValue = (documentId: DocumentId) => {
|
|
if (userContext.apiType === "Tables" && documentId.partitionKeyValue?.length === 0) {
|
|
return "";
|
|
}
|
|
if (documentId.partitionKeyValue?.length === 0) {
|
|
return undefined;
|
|
}
|
|
return documentId.partitionKeyValue;
|
|
};
|