Changeset b348db4 for database/drizzle/queries/components.ts
- Timestamp:
- 01/29/26 03:53:57 (5 months ago)
- Branches:
- main
- Children:
- c586cbd, f727252
- Parents:
- be22289
- File:
-
- 1 edited
-
database/drizzle/queries/components.ts (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
database/drizzle/queries/components.ts
rbe22289 rb348db4 104 104 } 105 105 106 export async function getDetails ForNewComponent(componentType: string) {106 export async function getDetailsNewComponent(componentType: string) { 107 107 const config = typeConfigMap[componentType as ComponentType]; 108 108 … … 1067 1067 ); 1068 1068 1069 const totalPrice = buildComponents.reduce((sum, c) =>1070 sum + (Number(c.price) * c.quantity), 01071 );1072 1073 await tx1074 .update(buildsTable)1075 .set({1076 totalPrice: totalPrice.toFixed(2)1077 })1078 .where(1079 eq(buildsTable.id, buildId)1080 );1069 // const totalPrice = buildComponents.reduce((sum, c) => 1070 // sum + (Number(c.price) * c.quantity), 0 1071 // ); 1072 1073 // await tx 1074 // .update(buildsTable) 1075 // .set({ 1076 // totalPrice: totalPrice.toFixed(2) 1077 // }) 1078 // .where( 1079 // eq(buildsTable.id, buildId) 1080 // ); 1081 1081 1082 1082 return buildId; … … 1151 1151 ); 1152 1152 1153 const totalPrice = buildComponents.reduce((sum, c) =>1154 sum + (Number(c.price) * c.quantity), 01155 );1156 1157 await tx1158 .update(buildsTable)1159 .set({1160 totalPrice: totalPrice.toFixed(2)1161 })1162 .where(1163 eq(buildsTable.id, buildId)1164 );1153 // const totalPrice = buildComponents.reduce((sum, c) => 1154 // sum + (Number(c.price) * c.quantity), 0 1155 // ); 1156 1157 // await tx 1158 // .update(buildsTable) 1159 // .set({ 1160 // totalPrice: totalPrice.toFixed(2) 1161 // }) 1162 // .where( 1163 // eq(buildsTable.id, buildId) 1164 // ); 1165 1165 1166 1166 return componentId;
Note:
See TracChangeset
for help on using the changeset viewer.
