fix: correct join condition for album assets in photo statistics

This commit is contained in:
sai80082
2026-02-05 15:55:23 +05:30
parent a9bcd694a0
commit b0607f310e
@@ -17,7 +17,7 @@ export default async function handler(
value: count(sql`DISTINCT ${assets.id}`),
})
.from(assets)
.innerJoin(albumsAssetsAssets, eq(assets.id, albumsAssetsAssets.assetsId))
.innerJoin(albumsAssetsAssets, eq(assets.id, albumsAssetsAssets.assetId))
.where(eq(assets.ownerId, currentUser.id));
// Count total photos