From 2ca21a7d6b80100d297dce32c01a4c918b58b4b2 Mon Sep 17 00:00:00 2001 From: Philippe <83185129+phil3838@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:16:04 -0400 Subject: [PATCH] folders id error fixed --- client/src/services/ApiService.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/services/ApiService.tsx b/client/src/services/ApiService.tsx index 7764555..fa2b4e7 100644 --- a/client/src/services/ApiService.tsx +++ b/client/src/services/ApiService.tsx @@ -1168,12 +1168,16 @@ public async login(email: string, password: string): Promise { const allQuizIds: string[] = []; - for (const folder of folders) { - const folderQuizzes = await this.getFolderContent(folder._id); + if (Array.isArray(folders)) { + for (const folder of folders) { + const folderQuizzes = await this.getFolderContent(folder._id); - if (Array.isArray(folderQuizzes)) { - allQuizIds.push(...folderQuizzes.map(quiz => quiz._id)); + if (Array.isArray(folderQuizzes)) { + allQuizIds.push(...folderQuizzes.map(quiz => quiz._id)); + } } + } else { + console.error('Failed to get user folders:', folders); } return allQuizIds;