Skip to content

Commit

Permalink
packages/network-explorer: remote pimary property types
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltg committed Jan 16, 2025
1 parent c18ee7c commit cdc9527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/network-explorer/src/ModelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ModelTable = ({
if (modelDefinition) {
// the primary property has kind 'primary' or is the first property in the model definition
const primaryProperty =
modelDefinition.properties.filter((p) => p.kind === "primary")[0] || modelDefinition.properties[0]
modelDefinition.properties.find((p) => p.name === modelDefinition.primaryKey) ?? modelDefinition.properties[0]
// use the primary property as the sorting column
const defaultSortColumn = primaryProperty.name
const defaultSortDirection = "asc"
Expand Down

0 comments on commit cdc9527

Please sign in to comment.