Fixes issue when CRUD with no parition key for all APIs (#1362)

* 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
This commit is contained in:
vchske
2022-12-13 11:36:39 -08:00
committed by GitHub
parent 950c8ee470
commit 2f32a676d0
4 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
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;
};