- File:
-
- 1 edited
-
database/drizzle/queries/builds.ts (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
database/drizzle/queries/builds.ts
re03e6fb r3870834 200 200 .select({ 201 201 componentId: buildComponentsTable.componentId, 202 component: componentsTable, 203 quantity: buildComponentsTable.numComponents 202 component: componentsTable 204 203 }) 205 204 .from(buildComponentsTable) … … 293 292 return { 294 293 ...buildDetails, 295 components: components.map(c => ({ 296 ...c.component, 297 quantity: c.quantity 298 })), 294 components: components.map(c => c.component), 299 295 reviews: reviews.map(r => ({ 300 296 username: r.username, … … 423 419 424 420 const existing = await tx 425 .select({ 426 componentId: buildComponentsTable.componentId, 427 numComponents: buildComponentsTable.numComponents 428 }) 421 .select({ componentId: buildComponentsTable.componentId }) 429 422 .from(buildComponentsTable) 430 423 .where(eq(buildComponentsTable.buildId, buildId)); … … 435 428 buildId: newBuild.id, 436 429 componentId: r.componentId, 437 numComponents: r.numComponents438 430 })), 439 431 ); … … 553 545 const components = await tx 554 546 .select({ 555 componentId: buildComponentsTable.componentId, 556 quantity: buildComponentsTable.numComponents 547 componentId: buildComponentsTable.componentId 557 548 }) 558 549 .from(buildComponentsTable) … … 563 554 return { 564 555 build, 565 components: components.map(c => ({ 566 id: c.componentId, 567 quantity: c.quantity 568 })) 556 componentIds: components.map(c => c.componentId) 569 557 }; 570 558 });
Note:
See TracChangeset
for help on using the changeset viewer.
