Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandra Sikora committed May 5, 2020
1 parent cf89d62 commit b1caba7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -55,7 +55,7 @@ import {
getPersistedColumnsOrder,
persistPageSizeChange,
} from './localStorageUtils';
import { compareRows, checkIfHasPrimaryKey } from './utils';
import { compareRows, isTableWithPK } from './utils';
import styles from '../../../Common/TableCommon/Table.scss';

const ViewRows = ({
Expand Down Expand Up @@ -620,7 +620,7 @@ const ViewRows = ({
const tableColumnsSorted = tableSchema.columns.sort(ordinalColSort);
const tableRelationships = tableSchema.relationships;

const hasPrimaryKey = checkIfHasPrimaryKey(tableSchema);
const hasPrimaryKey = isTableWithPK(tableSchema);

const isSingleRow = checkIfSingleRow(curRelName);

Expand Down
4 changes: 2 additions & 2 deletions console/src/components/Services/Data/TableBrowseRows/utils.ts
Expand Up @@ -7,7 +7,7 @@ type TableSchemaWithPK = {
[P in keyof TableSchema]-?: TableSchema[P];
};

export const checkIfHasPrimaryKey = (
export const isTableWithPK = (
tableSchema: TableSchema
): tableSchema is TableSchemaWithPK => {
return (
Expand All @@ -22,7 +22,7 @@ export const compareRows = (
isView: boolean
) => {
let same = true;
if (!isView && checkIfHasPrimaryKey(tableSchema)) {
if (!isView && isTableWithPK(tableSchema)) {
tableSchema.primary_key.columns.forEach(pk => {
if (row1[pk] !== row2[pk]) {
same = false;
Expand Down

0 comments on commit b1caba7

Please sign in to comment.