Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspwang committed Oct 16, 2022
2 parents c93e549 + aa850e4 commit de5851c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def setOncall():
session.close()
return jsonify(ret)

# post body: {"username": USERNAME, "friends" : ["username1", ...]}
# post body: {"username": USERNAME, "friend" : "username1"}
@users_bp.route('/addFriend/', methods=['POST'])
def addFriends():
data = request.json
Expand Down
Binary file added frontend/src/assets/angybees.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/src/components/FriendSearch/FriendSearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@
align-items: center;
}

.angybee {
max-width: 25%;
height: auto;
margin-left: 10px;
margin-bottom: -20px;
}
12 changes: 10 additions & 2 deletions frontend/src/components/FriendSearch/FriendSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ListItemText from '@mui/material/ListItemText';
import "./FriendSearch.css";

function FriendSearch() {
const searchUrl = "http://localhost:4000/users/addFriend/"
const searchUrl = "http://34.168.40.206:4000/users/addFriend/"

const [user, setUser] = useAtom(currUserAtom);
const [inputText, setInputText] = useState("");
Expand Down Expand Up @@ -77,9 +77,17 @@ function FriendSearch() {
// }
};

useEffect(() => {
getFriends();
console.log(user)
console.log(typeof friends)
console.log(friends)
}, [])

return (
<div className="outer-box">
<div className="main">
<img className="angybee" src={require("../../assets/angybees.png")}></img>
<div className="title">find friends</div>
<div className="search">
<TextField
Expand All @@ -101,7 +109,7 @@ function FriendSearch() {
</Button>
</div>
<p class="title"> current friends</p>
<List>
<List style={{ textAlignLast: "center" }}>
<>
{
friends.map(friend =>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/FriendsDropdown/FriendsDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function FriendsDropdown() {
};

const handleSubmit = async () =>{
const response = await fetch("http://localhost:4000/users/setOncall/", {
const response = await fetch("http://34.168.40.206:4000/users/setOncall/", {
mode: 'cors',
method: 'POST',
headers: {
Expand Down Expand Up @@ -161,4 +161,4 @@ export default function FriendsDropdown() {
</div>
</div>
);
}
}
4 changes: 2 additions & 2 deletions frontend/src/pages/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Login() {

const handleLogin = async () => {

const response = await fetch("http://localhost:4000/users/login/", {
const response = await fetch("http://34.168.40.206:4000/users/login/", {
mode: 'cors',
method: 'POST',
headers: {
Expand Down Expand Up @@ -140,4 +140,4 @@ function Login() {
)
}

export default Login
export default Login
4 changes: 2 additions & 2 deletions frontend/src/pages/SignUp/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function SignUp() {


const handleSignUp = async () => {
const response = await fetch("http://localhost:4000/users/newUser/", {
const response = await fetch("http://34.168.40.206:4000/users/newUser/", {
mode: 'cors',
method: 'POST',
headers: {
Expand Down Expand Up @@ -239,4 +239,4 @@ function SignUp() {
)
}

export default SignUp
export default SignUp

0 comments on commit de5851c

Please sign in to comment.