Esempio n. 1
0
		public async Task<IActionResult> Update(Guid userID, Guid likeID, UpdateLikeDto updateLikeInfo)
		{
			var like = new Like
			{
				ID = likeID,
				SenderID = userID
			};

			#region [Authorization]
			var result = await this.AuthorizationService.AuthorizeAsync
			(
				this.User, like, nameof(KindlyPolicies.AllowIfOwner)
			);

			if (result.Succeeded == false)
			{
				return this.Unauthorized();
			}
			#endregion

			this.Mapper.Map(updateLikeInfo, like);

			await this.Repository.Update(like);

			return this.Ok();
		}
Esempio n. 2
0
        public void Pulse_UnLikeUpdate_Pass()
        {
            try
            {
                var updateLikeDto = new UpdateLikeDto {
                    UserId = 5412166
                };

                _mondayClient.CreateUnLikeOnPulseUpdate(229899909, updateLikeDto).Wait();
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Esempio n. 3
0
 /// <summary>
 ///UnLike an update.
 /// </summary>
 /// <param name="updateId">The updates’s unique identifier.</param>
 /// <param name="updateLikeDto">The dto for user’s unique identifier.</param>
 /// <returns></returns>
 public async Task CreateUnLikeOnPulseUpdate(int updateId, UpdateLikeDto updateLikeDto)
 {
     await _mondayClient.PostUnLikeUpdateByUpdateIdAsync(updateId, updateLikeDto);
 }