From 12a04f0670dd31323868e1399608dc989b549dfb Mon Sep 17 00:00:00 2001 From: AzenKain Date: Sat, 9 May 2026 11:12:26 +0700 Subject: [PATCH] feat: add ChatbotController for handling AI chat queries and history retrieval --- internal/controllers/chatbotController.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controllers/chatbotController.go b/internal/controllers/chatbotController.go index 944bbd9..a6973bf 100644 --- a/internal/controllers/chatbotController.go +++ b/internal/controllers/chatbotController.go @@ -46,9 +46,9 @@ func (cx *ChatbotController) Chat(c fiber.Ctx) error { }) } - claims := c.Locals("user").(*response.JWTClaims) + uid := c.Locals("uid").(string) - answer, err := cx.chatbotService.Chat(ctx, claims.UId, dto.ProjectID, dto.Question) + answer, err := cx.chatbotService.Chat(ctx, uid, dto.ProjectID, dto.Question) if err != nil { if err.Error() == "you have reached your daily limit of 10 questions. Please come back tomorrow" { return c.Status(fiber.StatusTooManyRequests).JSON(response.CommonResponse{