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,23 @@ 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+ // It is causing N+1 query problem. We swap to no-op
53+ // until a patch is implemented.
54+ // -- Omar Ibrahim, May 26 26
55+ const likedByMe = false ;
56+ const interactionCounts = {
57+ view : 0 ,
58+ run : 0 ,
59+ download : 0 ,
60+ share : 0 ,
61+ } ;
5162
5263 return {
5364 model : modelMapper . toResponse ( model ) ,
You can’t perform that action at this time.
0 commit comments