File tree Expand file tree Collapse file tree
apps/modeling-commons-backend/src/modules/model/queries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,12 +42,26 @@ export default function makeGetModelCardQuery({
4242 ? await fileService . getUrl ( latestWithTags . previewImageFileKey )
4343 : null ;
4444
45- const [ interactionCounts , likedByMe ] = await Promise . all ( [
46- modelInteractionRepository . countsByKindForModel ( model . id ) ,
47- viewerUserId
48- ? modelLikeRepository . existsFor ( model . id , viewerUserId )
49- : Promise . resolve ( false ) ,
50- ] ) ;
45+ // const [interactionCounts, likedByMe] = await Promise.all([
46+ // modelInteractionRepository.countsByKindForModel(model.id),
47+ // viewerUserId
48+ // ? modelLikeRepository.existsFor(model.id, viewerUserId)
49+ // : Promise.resolve(false),
50+ // ]);
51+
52+ const likedByMe = viewerUserId
53+ ? await modelLikeRepository . existsFor ( model . id , viewerUserId )
54+ : false ;
55+
56+ // It is causing N+1 query problem. We swap to no-op
57+ // until a patch is implemented.
58+ // -- Omar Ibrahim, May 26 26
59+ const interactionCounts = {
60+ view : 0 ,
61+ run : 0 ,
62+ download : 0 ,
63+ share : 0 ,
64+ } ;
5165
5266 return {
5367 model : modelMapper . toResponse ( model ) ,
You can’t perform that action at this time.
0 commit comments