Skip to content

Commit

Permalink
Fix data over-fetching in search-browse list
Browse files Browse the repository at this point in the history
  • Loading branch information
solomonhawk committed Nov 19, 2024
1 parent fc20c91 commit d74619e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/features/table/pages/detail/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export function TableDetail() {
</section>

<section>
<h3 className="mb-8 font-semibold">Try it out:</h3>
<h3 className="mb-8 font-semibold">Try it out</h3>

<RollPreview
definition={injectNamespacePragmasWorkaround(
Expand Down
15 changes: 14 additions & 1 deletion packages/db/src/service/table-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,20 @@ export async function listTableVersions(input: TableVersionListInput) {
.offset(offset);

return {
data: tableVersions,
data: tableVersions.map((tableVersion) => ({
id: tableVersion.id,
title: tableVersion.title,
tableSlug: tableVersion.tableSlug,
tableIdentifier: tableVersion.tableIdentifier,
ownerUsername: tableVersion.ownerUsername,
availableTables: tableVersion.availableTables,
createdAt: tableVersion.createdAt,
updatedAt: tableVersion.updatedAt,
table: {
title: tableVersion.table.title,
description: tableVersion.table.description,
},
})),
pagination: pagination.toMetadata({
count: tableVersions.length ? tableVersions[0].totalCount : 0,
}),
Expand Down

0 comments on commit d74619e

Please sign in to comment.