Esempio n. 1
0
        public async Task <IActionResult> MarkMessagesAsRead(int userId, MessageReadDto messageIds)
        {
            Claim claim = User.FindFirst(ClaimTypes.NameIdentifier);

            if (!_jwtClaimValidator.UserIdConfirmed(userId, claim))
            {
                return(Unauthorized());
            }


            await _messageRepository.UpdateMessagesAsRead(userId, messageIds.MessageIds);

            await _datingRepository.SaveAllAsync();

            return(NoContent());
        }
Esempio n. 2
0
 public async Task <ApiResult <string> > Read([FromBody] MessageReadDto obj)
 {
     if (obj.type == 0)
     {
         return(await _messageService.UpdateAsync(m => new CmsMessage()
         {
             Status = true
         }, m => m.Id == obj.parm));
     }
     else
     {
         return(await _messageService.UpdateAsync(m => new CmsMessage()
         {
             Status = true
         }, m => true));
     }
 }