Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaditya019Jain committed Oct 12, 2023
2 parents a0678f5 + f8ae03c commit d0ca535
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 306 deletions.
2 changes: 1 addition & 1 deletion backend/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_queryset(self):

if query is not None and query != "":
if re.search(r"\d", query):
queryset = queryset.filter(roll_number__istarts_with=query)
queryset = queryset.filter(roll_number__iexact=query)
else:
queryset = queryset.annotate(
full_name=Concat("first_name", V(" "), "last_name")
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "soc_app",
"proxy": "http://localhost:8000/",
"proxy": "http://127.0.0.1:8000/",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import './App.css';
import React from 'react';
import MenteeForm from "./MenteeForm"
import Navbar from './components/Navbar';
import Textform from './components/Textform';
import Reviews from './components/Reviews';
Expand All @@ -11,7 +10,8 @@ import Button from './components/Button';
import { Routes, Route } from "react-router-dom";
import Dashboard from './components/Dashboard';
import ProjectCard from './components/ProjectCard';
import ProjectForm from './components/ProjectFrom';
import ProjectForm from './pages/ProjectFrom';
import Register from './pages/Register';


export default function App() {
Expand All @@ -21,7 +21,7 @@ export default function App() {
<Navbar title="SOC" />
<Routes>
<Route path="/" element={<Textform />} />
<Route path="/register" element={<MenteeForm />} />
<Route path="/register" element={<Register />} />
<Route path="/login" element={<Login/>}/>
<Route path="/current_projects" element={<Projects/>}/>
{/* <Route path="/course" element={<Courses />} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import ProjectForm from "./ProjectFrom";
import ProjectForm from "../pages/ProjectFrom";
import './scrollable.css'


Expand Down
132 changes: 0 additions & 132 deletions frontend/src/components/MenteeForm.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
// import PropTypes from "prop-types";
import MenteeForm from "./MenteeForm";
import {
Link
} from "react-router-dom";
Expand All @@ -13,13 +12,6 @@ import {
// },
// ]);

const routes = [
{
path: '/',
element: <MenteeForm />,
},
// Add more routes as needed
];

// const router = createBrowserRouter(routes);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import axios from "axios";
import { useState } from "react";
import MyComponent from "./MyComponent";
import MyComponent2 from "./MyComponent2";
import MyComponent from "../components/MyComponent";
import MyComponent2 from "../components/MyComponent2";



Expand All @@ -14,18 +14,11 @@ export default function ProjectForm(){

})

const [roll_number,setRoll_number] = useState({
roll_number : '',
})
const [roll_number,setRoll_number] = useState()


const handleChange = (e) => {
const {id,value} = e.target;
// console.log(roll_number)
setRoll_number((prevRoll_number) => ({
...prevRoll_number,
[id]: value,
}));
const handleRollNumberChange = (e) => {
setRoll_number(e.target.value);
}

// const [toggle,setToggle] = useState(false)
Expand All @@ -34,9 +27,10 @@ export default function ProjectForm(){
const handleSubmit = (e) => {
// console.log(roll_number)
e.preventDefault();
axios.get('/api/accounts/',roll_number)
console.log(roll_number)
axios.get('/api/accounts/'+'?search='+roll_number)
.then( function(roll_number){
console.log(roll_number.data[0].roll_number)
console.log(roll_number.data)
})
.catch( err =>{
alert(err);
Expand All @@ -50,7 +44,7 @@ export default function ProjectForm(){
<input type='text' />
<br></br>
<label>
<input id='roll_number' type='search' placeholder="Enter Roll number"/>
<input id='roll_number' type='search' onChange={handleRollNumberChange}/>
<button onClick={handleSubmit}>
Search
</button>
Expand Down
Loading

0 comments on commit d0ca535

Please sign in to comment.