daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let data: Deal[] = await getRepository(Deal)
  2.   .createQueryBuilder('deal')
  3.   .leftJoinAndSelect('deal.likes', 'like', `like.user = ${user.id}`)
  4.   .offset(offset)
  5.   .limit(limit)
  6.   //.orderBy(`deal.${param.sortField}`, order[param.sortField])
  7.   .getMany();
  8.  
  9. data.map(function(singleDeal, index) {
  10.   singleDeal.likes = (singleDeal.likes[0]) ? singleDeal.likes[0].isDeleted : true;
  11. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top