From 45d4ae0f39430f25ed906c5516491bcc15840709 Mon Sep 17 00:00:00 2001 From: Prabhat Kumar Date: Thu, 3 Oct 2024 15:06:46 +0800 Subject: [PATCH] sorted question as response --- frontend/src/services/question.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/services/question.service.ts b/frontend/src/services/question.service.ts index 8bbbe33b4b..800a87fb64 100644 --- a/frontend/src/services/question.service.ts +++ b/frontend/src/services/question.service.ts @@ -12,7 +12,8 @@ export default class QuestionService { static async getQuestions(): Promise { const response = await QuestionService.client.get("/"); - return response.data; + let questions = response.data.sort((a: Question, b: Question) => a.questionId - b.questionId); + return questions; } static async addQuestion(