-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FE + BE for collecting user feedback
1. Created FE component for user feedback 2. Created helper func for FE component 3. Created Endpoint, Model, Service, Router for BE portion
- Loading branch information
1 parent
f637586
commit 8298a50
Showing
12 changed files
with
191 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ frontend/.env | |
frontend/package-lock.json | ||
backend/package-lock.json | ||
venv | ||
.venv | ||
.env | ||
android | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Request, Response } from "express"; | ||
import * as feedbackService from "../services/feedbackService"; | ||
import handleError from "../errors/errorHandling"; | ||
|
||
export const sendFeedback = async (req: Request, res: Response) => { | ||
const messageBody = req.body; | ||
|
||
try { | ||
const message = await feedbackService.sendMessage(messageBody); | ||
res.status(200).json({ message: 'Published message successfully' }); | ||
} catch (error: any) { | ||
const errorResponse = handleError(error); | ||
if (errorResponse) { | ||
res.status(errorResponse.status).json(errorResponse); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface Feedback { | ||
userID: string; | ||
timestamp: Date; | ||
eventType: "feedback" | "bug" | "sugestion"; | ||
rating: number; | ||
message: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,14 @@ | |
}, | ||
{ | ||
"timeTaken": 1718 | ||
}, | ||
{ | ||
"feedback": 1618 | ||
}, | ||
{ | ||
"bug": 1518 | ||
}, | ||
{ | ||
"suggestion": 1418 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as feedbackController from '../controllers/feedbackController'; | ||
import { Router } from 'express'; | ||
import verifyToken from '../middleware/authMiddleware'; | ||
|
||
const router = Router(); | ||
|
||
router.post('/sendFeedback', verifyToken, feedbackController.sendFeedback); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.