|
|
@@ -6,6 +6,8 @@ import { Feedback, sendFeedback } from "#/services/feedbackService";
|
|
|
import FeedbackForm from "./FeedbackForm";
|
|
|
import toast from "#/utils/toast";
|
|
|
|
|
|
+const VIEWER_PAGE = "https://od-feedback.vercel.app/show";
|
|
|
+
|
|
|
interface FeedbackModalProps {
|
|
|
feedback: Feedback;
|
|
|
handleEmailChange: (key: string) => void;
|
|
|
@@ -26,12 +28,14 @@ function FeedbackModal({
|
|
|
const handleSendFeedback = () => {
|
|
|
sendFeedback(feedback)
|
|
|
.then((response) => {
|
|
|
- if (response.message === "Feedback submitted successfully") {
|
|
|
- toast.info(response.message);
|
|
|
+ if (response.statusCode === 200) {
|
|
|
+ const { message, feedback_id: feedbackId, password } = response.body;
|
|
|
+ const toastMessage = `${message}\nFeedback link: ${VIEWER_PAGE}?feedback_id=${feedbackId}\nPassword: ${password}`;
|
|
|
+ toast.info(toastMessage);
|
|
|
} else {
|
|
|
toast.error(
|
|
|
"share-error",
|
|
|
- `Failed to share, please contact the developers: ${response.message}`,
|
|
|
+ `Failed to share, please contact the developers: ${response.body.message}`,
|
|
|
);
|
|
|
}
|
|
|
})
|