Ignore:
Timestamp:
03/24/26 22:13:36 (3 months ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Children:
7fbb91c
Parents:
acf690c
Message:

Fixed reading lists,comments and likes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ChapterX.Infrastructure/Repositories/ReadingListItemsRepository.cs

    racf690c r73b69b2  
    1414        public async Task<bool> ExistsAsync(int listId, int storyId, CancellationToken cancellationToken = default)
    1515            => await _dbSet.AnyAsync(i => i.ListId == listId && i.StoryId == storyId, cancellationToken);
     16
     17        public async Task<bool> DeleteByListAndStoryAsync(int listId, int storyId, CancellationToken cancellationToken = default)
     18        {
     19            var item = await _dbSet.FirstOrDefaultAsync(i => i.ListId == listId && i.StoryId == storyId, cancellationToken);
     20            if (item == null) return false;
     21            _dbSet.Remove(item);
     22            await _context.SaveChangesAsync(cancellationToken);
     23            return true;
     24        }
    1625    }
    1726}
Note: See TracChangeset for help on using the changeset viewer.