Classroom ile ilgili hatalar

This commit is contained in:
Sedat Öztürk 2025-08-29 22:04:53 +03:00
parent 43f1cf9fe5
commit c00bc1acf0
2 changed files with 1 additions and 22 deletions

View file

@ -261,13 +261,6 @@ public class ClassroomAppService : PlatformAppService, IClassroomAppService
public async Task<List<ClassroomAttendanceDto>> GetAttendanceAsync(Guid sessionId) public async Task<List<ClassroomAttendanceDto>> GetAttendanceAsync(Guid sessionId)
{ {
var classSession = await _classSessionRepository.GetAsync(sessionId);
if (classSession.TeacherId != CurrentUser.Id)
{
throw new UnauthorizedAccessException("Only the teacher can view attendance");
}
var attendanceRecords = await _attendanceRepository.GetListAsync( var attendanceRecords = await _attendanceRepository.GetListAsync(
x => x.SessionId == sessionId x => x.SessionId == sessionId
); );
@ -277,13 +270,6 @@ public class ClassroomAppService : PlatformAppService, IClassroomAppService
public async Task<List<ClassroomParticipantDto>> GetParticipantAsync(Guid sessionId) public async Task<List<ClassroomParticipantDto>> GetParticipantAsync(Guid sessionId)
{ {
var classSession = await _classSessionRepository.GetAsync(sessionId);
if (classSession.TeacherId != CurrentUser.Id)
{
throw new UnauthorizedAccessException("Only the teacher can view participant");
}
var participantRecords = await _participantRepository.GetListAsync( var participantRecords = await _participantRepository.GetListAsync(
x => x.SessionId == sessionId x => x.SessionId == sessionId
); );
@ -293,13 +279,6 @@ public class ClassroomAppService : PlatformAppService, IClassroomAppService
public async Task<List<ClassroomChatDto>> GetChatAsync(Guid sessionId) public async Task<List<ClassroomChatDto>> GetChatAsync(Guid sessionId)
{ {
var classSession = await _classSessionRepository.GetAsync(sessionId);
if (classSession.TeacherId != CurrentUser.Id)
{
throw new UnauthorizedAccessException("Only the teacher can view chat");
}
var chatRecords = await _chatRepository.GetListAsync( var chatRecords = await _chatRepository.GetListAsync(
x => x.SessionId == sessionId x => x.SessionId == sessionId
); );

View file

@ -346,7 +346,7 @@ const RoomDetail: React.FC = () => {
const handleLeaveCall = async () => { const handleLeaveCall = async () => {
try { try {
// Eğer teacher ise sınıfı kapat // Eğer teacher ise sınıfı kapat
if (user.role === 'teacher') { if (user.role === 'teacher' && user.id === classSession.teacherId) {
await endClassroom(classSession.id) await endClassroom(classSession.id)
} }