- src/lib/db/piclets.ts +7 -10
src/lib/db/piclets.ts
CHANGED
|
@@ -122,20 +122,17 @@ export async function getCollectedPiclets(): Promise<PicletInstance[]> {
|
|
| 122 |
});
|
| 123 |
});
|
| 124 |
|
| 125 |
-
//
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
return result;
|
| 130 |
-
} catch (error) {
|
| 131 |
-
console.error('❌ Query failed:', error);
|
| 132 |
-
throw error;
|
| 133 |
-
}
|
| 134 |
}
|
| 135 |
|
| 136 |
// Get canonical piclets
|
| 137 |
export async function getCanonicalPiclets(): Promise<PicletInstance[]> {
|
| 138 |
-
|
|
|
|
|
|
|
| 139 |
}
|
| 140 |
|
| 141 |
// Get piclets by object name
|
|
|
|
| 122 |
});
|
| 123 |
});
|
| 124 |
|
| 125 |
+
// Filter by isInCollection (using filter instead of where/equals for boolean reliability)
|
| 126 |
+
const result = allRecords.filter(p => p.isInCollection === true);
|
| 127 |
+
console.log('✅ Filtered result:', result.length, 'piclets found');
|
| 128 |
+
return result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
}
|
| 130 |
|
| 131 |
// Get canonical piclets
|
| 132 |
export async function getCanonicalPiclets(): Promise<PicletInstance[]> {
|
| 133 |
+
// Use filter for boolean fields to avoid index issues
|
| 134 |
+
const allRecords = await db.picletInstances.toArray();
|
| 135 |
+
return allRecords.filter(p => p.isCanonical === true);
|
| 136 |
}
|
| 137 |
|
| 138 |
// Get piclets by object name
|