Skip to content

Commit

Permalink
(web) fix typing issue in data insert form
Browse files Browse the repository at this point in the history
  • Loading branch information
joewagner committed Jun 6, 2024
1 parent 96d71eb commit 88c033b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 5 additions & 5 deletions packages/web/components/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function DataTable({
const readDb = new Database({ baseUrl });
const validator = new Validator({ baseUrl });

// Some tables are escaped with the tick mark, need to remove those from the column name
// Some tables are escaped with ``, "", or []. We need to remove those from the column name
const cols = columns.map((col: any) => {
const formattedName = formatIdentifierName(col.name);
return { accessorKey: formattedName, header: formattedName };
Expand Down Expand Up @@ -319,13 +319,13 @@ export function DataTable({
constraints:{" "}
<b>
{typeof columns !== "undefined" &&
columns
.find((col: any) => {
(
columns.find((col: any) => {
return (
formatIdentifierName(col.name) === cell.id
);
})
?.constraints?.join(", ")}
})?.constraints ?? ["none"]
).join(", ")}
</b>
</p>
<Input
Expand Down
7 changes: 1 addition & 6 deletions packages/web/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,7 @@ export default async function Table({
const table = validator
? await validator.getTableById({ chainId, tableId })
: null;
const columns = (table?.schema?.columns ?? []).map(function (col) {
if (!col.constraints) col.constraints = [];
if (col.constraints.length === 0) col.constraints.push("none");

return col;
});
const columns = table?.schema?.columns ?? [];

const deploymentReferences = invalidChain
? []
Expand Down

0 comments on commit 88c033b

Please sign in to comment.