Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/singhchanmeet/ERP
Browse files Browse the repository at this point in the history
  • Loading branch information
singhchanmeet committed Nov 14, 2023
2 parents 3c76664 + b32cfbf commit fdd2ac9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 17 deletions.
12 changes: 3 additions & 9 deletions frontend/src/components/Student Portal/DetailsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const DetailsForm = () => {

useEffect(() => {
// Fetch the user details from your API
axios.get('http://localhost:8000s/', {
axios.get('https://erp.mait.ac.in/user-details/', {
headers: {
'Authorization': `Bearer ${accessToken}`, // Add the token to the 'Authorization' header
'Content-Type': 'application/json', // Adjust headers as needed
Expand All @@ -123,7 +123,7 @@ const DetailsForm = () => {
}, [accessToken]);

useEffect(() => {
axios.get('http://localhost:8000/student/personal-details/', {
axios.get('https://erp.mait.ac.in/student/personal-details/', {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
Expand Down Expand Up @@ -237,7 +237,7 @@ const DetailsForm = () => {
setFormErrors(newFormErrors);
}
else {
axios.post('http://localhost:8000/student/personal-details/', studentDetails, {
axios.post('https://erp.mait.ac.in/student/personal-details/', studentDetails, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'multipart/form-data',
Expand Down Expand Up @@ -355,7 +355,6 @@ const DetailsForm = () => {
id="name"
value={studentDetails.name}
onChange={handleInputChange}
autoComplete="given-name"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" required
/>
</div>
Expand Down Expand Up @@ -394,7 +393,6 @@ const DetailsForm = () => {
placeholder="Email"
value={studentDetails.email}
onChange={handleInputChange}
autoComplete="email"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" required
/>
</div>
Expand Down Expand Up @@ -430,7 +428,6 @@ const DetailsForm = () => {
value={studentDetails.mobile_number}
onChange={handleInputChange}
id="mobile_number"
autoComplete="mobile_number"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
required
/>
Expand All @@ -449,7 +446,6 @@ const DetailsForm = () => {
placeholder="Gender"
value={studentDetails.gender}
onChange={handleInputChange}
autoComplete="gender"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:max-w-xs sm:text-sm sm:leading-6"
required
>
Expand All @@ -474,7 +470,6 @@ const DetailsForm = () => {
value={studentDetails.category}
id='category'
onChange={handleInputChange}
autoComplete="category"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:max-w-xs sm:text-sm sm:leading-6"
required
>
Expand Down Expand Up @@ -502,7 +497,6 @@ const DetailsForm = () => {
value={studentDetails.region}
id='region'
onChange={handleInputChange}
autoComplete="country-name"
className="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:max-w-xs sm:text-sm sm:leading-6"
required
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Student Portal/StudentDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const StudentDashboard = ({ user }) => {
const accessToken = localStorage.getItem('accessToken');
const [formFilled, setFormFilled] = useState(false);
useEffect(() => {
axios.get('http://localhost:8000/student/personal-details/', {
axios.get('https://erp.mait.ac.in/student/personal-details/', {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function StudentRegistration() {

const handleRegister = async () => {
try {
const response = await axios.post('http://localhost:8000/student/register/', {
const response = await axios.post('https://erp.mait.ac.in/student/register/', {
user_id,
name,
email,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/standard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Dashboard = ({ loggedin, handleLogout }) => {

useEffect(() => {
// Fetch the user details from your API
axios.get('http://localhost:8000/user-details/', {
axios.get('https://erp.mait.ac.in/user-details/', {
headers: {
'Authorization': `Bearer ${accessToken}`, // Add the token to the 'Authorization' header
'Content-Type': 'application/json', // Adjust headers as needed
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/standard/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Navbar = () => {
const accessToken = localStorage.getItem('accessToken');
useEffect(() => {
// Fetch the user details from your API
axios.get('http://localhost:8000/user-details/', {
axios.get('https://erp.mait.ac.in/user-details/', {
headers: {
'Authorization': `Bearer ${accessToken}`, // Add the token to the 'Authorization' header
'Content-Type': 'application/json', // Adjust headers as needed
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/Employee/employeeState.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom"

const EmployeeState = (props) => {
const navigate = useNavigate();
const host = "http://localhost:8000"
const host = "https://erp.mait.ac.in"
const credsInitial = []
const [creds, setCreds] = useState(credsInitial)
//manage marks
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/Students/studentState.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';

const StudentState = (props) => {
const navigate = useNavigate();
const host = 'http://localhost:8000';
const host = 'https://erp.mait.ac.in';
const studentDetailsInitial = []; // Rename 'creds' to 'studentDetails'
const [studentDetails, setStudentDetails] = useState(studentDetailsInitial);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/auth/authState.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const AuthState = (props) => {
// Use destructuring to extract navigate from the useNavigate hook
const navigate = useNavigate();

const host = "http://localhost:8000";
const host = "https://erp.mait.ac.in";

// Use useState initializers to fetch tokens from localStorage
const [accessToken, setAccessToken] = useState(() => localStorage.getItem("accessToken") || null);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/utils/utilsState.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom"

const UtilsState = (props) => {
const navigate = useNavigate();
const host = "http://localhost:8000"
const host = "https://erp.mait.ac.in"
const credsInitial = []
const [creds, setCreds] = useState(credsInitial)

Expand Down

0 comments on commit fdd2ac9

Please sign in to comment.