Ignore:
Timestamp:
12/10/25 13:44:07 (10 months ago)
Author:
Stefan-Saveski <stefansaveski19@…>
Branches:
master
Children:
f735dac
Parents:
ab652ff
Message:

Add getSemesters endpoint and related data access

Introduce a new getSemesters endpoint in UserController.cs to retrieve user semester data using JWT authentication.

Add DbSet<EnrolledSemesters> to AppDbContext.cs for database interaction.

Implement GetUserSemestersAsync in UserRepository.cs to fetch semesters by user ID, and update IUserRepository.cs to declare this method.

Add GetUserSemesters method in UserService.cs to extract user ID from JWT and retrieve semesters, updating IUserService.cs accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Repository/Implementations/UserRepository.cs

    rab652ff r615f18d  
    6363            return await _context.User.CountAsync();
    6464        }
     65        public async Task<List<EnrolledSemesters>> GetUserSemestersAsync(int id)
     66        {
     67            return await _context.EnrolledSemesters
     68                .Include(es => es.Major)
     69                .Where(es => es.UserId == id)
     70                .ToListAsync();
     71        }
    6572
    6673    }
Note: See TracChangeset for help on using the changeset viewer.