@zodic/shared 0.0.224 → 0.0.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1043,27 +1043,32 @@ export class ConceptService {
1043
1043
  console.log(`📡 Fetching duplicate entries for concept: ${conceptSlug}...`);
1044
1044
 
1045
1045
  const duplicateEntries = await db
1046
- .select({
1047
- id: conceptsData.id,
1048
- name: conceptsData.name,
1049
- description: conceptsData.description,
1050
- combination: conceptsData.combination,
1051
- })
1052
- .from(conceptsData)
1053
- .where(
1054
- and(
1055
- eq(conceptsData.language, 'en-us'), // English version only
1056
- eq(conceptsData.conceptSlug, conceptSlug), // ✅ Filter by concept
1057
- sql`name IN (
1058
- SELECT name FROM concepts_data
1046
+ .select({
1047
+ id: conceptsData.id,
1048
+ name: conceptsData.name,
1049
+ description: conceptsData.description,
1050
+ combination: conceptsData.combination,
1051
+ })
1052
+ .from(conceptsData)
1053
+ .where(
1054
+ and(
1055
+ eq(conceptsData.language, 'en-us'), // English only
1056
+ eq(conceptsData.conceptSlug, conceptSlug), // ✅ Filter by concept
1057
+ sql`
1058
+ name IN (
1059
+ SELECT name
1060
+ FROM concepts_data
1059
1061
  WHERE language = 'en-us' AND concept_slug = ${conceptSlug}
1060
- GROUP BY name HAVING COUNT(*) > 1
1061
- )`
1062
- )
1062
+ GROUP BY name
1063
+ HAVING COUNT(*) > 1
1064
+ )
1065
+ `
1063
1066
  )
1064
- .limit(maxEntries || 50) // ✅ Apply optional limit
1065
- .execute();
1066
-
1067
+ )
1068
+ .orderBy(conceptsData.name) // ✅ Order by name for better grouping
1069
+ .limit(maxEntries || 50) // ✅ Apply optional limit
1070
+ .execute();
1071
+
1067
1072
  if (!duplicateEntries.length) {
1068
1073
  console.log(`🎉 No duplicates found for ${conceptSlug}.`);
1069
1074
  return { message: `No duplicates detected for ${conceptSlug}.` };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.224",
3
+ "version": "0.0.225",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {