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