public async Task <IHttpActionResult> Unlink(WishGiftLinkDto participantDto) { var userId = long.Parse(User.Identity.GetUserId()); await _linkRepository.Unlink(userId, participantDto.WishId, participantDto.GiftId); return(EmptyApiResult()); }
public async Task <IHttpActionResult> LinkWithGift(WishGiftLinkDto participantDto) { var userId = long.Parse(User.Identity.GetUserId()); try { var ownerWishUserId = await _linkRepository.LinkWithGift(userId, participantDto.WishId, participantDto.GiftId); await _notificationService.SentNotificationToQueue(new JoinQueueNotification() { CreatorId = userId, OwnerWish = ownerWishUserId, TargetWishId = participantDto.WishId, TargetGiftId = participantDto.GiftId }); } catch (ExceptionWithCode e) { return(ErrorApiResult(e.ErrorCode, e.Message)); } return(EmptyApiResult()); }