Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help Update #129

Merged
merged 20 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ import Dashboard from './Pages/Help/CCManager/Dashboard'
import SupportTicketDashboardPage from './Pages/Help/CCManager/SupportTicket'
import FeedbackDashboard from './Pages/Help/CCManager/FeedbackDashboard'
import Calendly from './Components/Help/Calendly'
import LoginForm from './Components/Help/LoginForm'
import SignupForm from './Components/Help/SignupForm'
// import CCMProfile from './Pages/Help/CCManager/CCMProfile'

// Define all routes in a single Router
Expand Down Expand Up @@ -331,6 +333,8 @@ const router = createBrowserRouter(
path="/help/dashboard/feedbacks"
element={<FeedbackDashboard />}
/>
<Route path="/help/login" element={<LoginForm />} />
<Route path="/help/signup" element={<SignupForm />} />
<Route
path="/help/dashboard/support-tickets"
element={<SupportTicketDashboardPage />}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Components/Help/HelpHeroSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const HelpHeroSection = () => {
New
</span>{' '}
<span className="text-sm font-medium text-black">
Need Instant Help? 🚀 Our Live Chat is Coming Soon
to Assist You in Real-Time! 👋
Need Assistance? We’re Here to Help! Start Live Chat
👋
</span>
<svg
className="w-5 h-5 ml-2"
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/Components/Help/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const NavBar = () => {
<div className="sticky top-0 z-50 backdrop-blur-md bg-white/60 ">
<div className="bg-[#b8f724] p-2">
<h1 className="max-w-2xl px-2 py-3 mx-auto text-sm font-semibold text-center">
Need Instant Help? 🚀 Our Live Chat is Coming Soon to Assist
You in Real-Time! 👋
Need Assistance? 🚀 We’re Here to Help! Start Live Chat 👋
</h1>
</div>
<div className="px-10 py-6 border-b">
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/Components/Help/SignupForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ const SignupForm = () => {
const handleSubmit = async (e) => {
e.preventDefault()
try {
const response = await axios.post(
`${import.meta.env.VITE_API_URL}/help/auth/signup`,
formData
)
const response = await axios.post(`/api/help/auth/signup`, formData)

console.log('Signup successful:', response.data)
toast.success(
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/Components/Help/dashboard/FeedbackCharts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const FeedbackCharts = () => {
useEffect(() => {
const fetchFeedbacks = async () => {
try {
const response = await axios.get(
`${import.meta.env.VITE_API_URL}/help/feedback`
)
const response = await axios.get(`/api/help/feedback`)
setFeedbacks(response.data)
} catch (err) {
setError(err.message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const FeedbackDataViewTable = () => {
useEffect(() => {
const fetchFeedbacks = async () => {
try {
const response = await fetch(
`${import.meta.env.VITE_API_URL}/help/feedback`
)
const response = await fetch(`/api/help/feedback`)
if (!response.ok) {
throw new Error('Failed to fetch feedbacks')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const FeedbackOverviewTable = () => {
useEffect(() => {
const fetchFeedbacks = async () => {
try {
const response = await axios.get(
`${import.meta.env.VITE_API_URL}/help/feedback`
) // Use the environment variable here
const response = await axios.get(`/api/help/feedback`) // Use the environment variable here
setFeedbacks(response.data)
} catch (err) {
setError(err.message)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Help/dashboard/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Overview = () => {
<div className="flex items-end justify-end">
<button className=" bg-[#99dd05] text-black text-xs p-3 m-2 rounded-md items-end ">
<Link to="/help/dashboard/feedbacks">
View All Feedbacks
View All Tickets
</Link>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const SupportTicketCharts = () => {
useEffect(() => {
const fetchTickets = async () => {
try {
const response = await fetch(
`${import.meta.env.VITE_API_URL}/help/support-tickets`
)
const response = await fetch(`/api/help/support-tickets`)
if (!response.ok) {
throw new Error('Failed to fetch tickets')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const SupportTicketFullViewTable = () => {
useEffect(() => {
const fetchTickets = async () => {
try {
const response = await fetch(
`${import.meta.env.VITE_API_URL}/help/support-tickets`
)
const response = await fetch(`/api/help/support-tickets`)
if (!response.ok) {
throw new Error('Failed to fetch tickets')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const SupportTicketOverviewTable = () => {
useEffect(() => {
const fetchTickets = async () => {
try {
const response = await axios.get(
`${import.meta.env.VITE_API_URL}/help/support-tickets`
)
const response = await axios.get(`/api/help/support-tickets`)
console.log('Fetched Tickets:', response.data) // Log fetched tickets
setTickets(response.data)
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/Help/CCManager/OtpEntry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link, useNavigate } from 'react-router-dom'
const OtpEntry = () => {
const [otp, setOtp] = useState('')
const navigate = useNavigate() // To programmatically navigate after OTP verification
const VERIFY_OTP_URL = `${import.meta.env.VITE_API_URL}/help/auth/verify-email`
const VERIFY_OTP_URL = `/api/help/auth/verify-email`

const handleChange = (e) => {
setOtp(e.target.value)
Expand Down
Loading