Skip to content

Commit

Permalink
fix data insertion for cluster matching
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Jan 22, 2025
1 parent 734dbab commit 09d5c92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/adapters/cocmAdapter/cocmAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CocmAdapter implements CocmAdapterInterface {
i18n.__(translationErrorMessagesKeys.CLUSTER_MATCHING_API_ERROR),
);
}
return result.data;
return result.data.matching_data;
} catch (e) {
logger.error('clusterMatchingApi error', e);
throw new Error(
Expand Down
7 changes: 4 additions & 3 deletions src/workers/cocm/estimatedClusterMatchingWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ const worker: EstimatedClusterMatchingWorker = {
const params: any[] = [];
const values = matchingData
.map((data, index) => {
const baseIndex = index * 3;
params.push(data.project_name, qfRoundId, data.matching_amount);
return `(
(SELECT id FROM project WHERE title = $${index * 3 + 1}),
$${index * 3 + 2},
$${index * 3 + 3}
(SELECT id FROM project WHERE title = $${baseIndex + 1}),
$${baseIndex + 2},
$${baseIndex + 3}
)`;
})
.join(',');
Expand Down

0 comments on commit 09d5c92

Please sign in to comment.