Skip to content

Commit

Permalink
Fix duplicate users in search page
Browse files Browse the repository at this point in the history
Fix duplicate users in search page
  • Loading branch information
tobyyu007 authored Dec 5, 2023
2 parents 374e318 + 5bf34ec commit 5021966
Show file tree
Hide file tree
Showing 22 changed files with 415 additions and 870 deletions.
3 changes: 2 additions & 1 deletion backend/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def setUserInfoCategory(email, category, data):
setUserInfoDatabase(email = email, transaction_id = transaction_id)

def getUserList():
return getUserListDatabase()
database = getUserListDatabase()
return list(database.values())

# For testing use
def getUserResume(email, category): # This function is for the edit page, which will ask for the resume data for a specific category
Expand Down
15 changes: 8 additions & 7 deletions backend/localdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
loginDatabase = {}
userInfoDatabase = {}
userKeyPairDatabase = {}
userListDatabase = []
userListDatabase = {}

def getUserLoginDatabase(email):
if email not in loginDatabase:
Expand Down Expand Up @@ -39,12 +39,12 @@ def getUserListDatabase():
return userListDatabase

def setUserListDatabase(email, name, position):
new_user = {
# if email not in userListDatabase:
userListDatabase[email] = {
"email": email,
"name": name,
"position": position
}
userListDatabase.append(new_user)


if __name__ == "__main__":
Expand All @@ -65,16 +65,17 @@ def setUserListDatabase(email, name, position):
"CX62ckRaUucsVi3cbxCkSAcxR7zsBBNSPPrEHz26X4vz": "DZBpCfHDsQhvy9vLkcRKYskfSaXwrGQTfzzKVJTvzQN9"
}

userListDatabase = [
{

userListDatabase = {
"[email protected]": {
"email": "[email protected]",
"name": "Jack",
"position": "Software Engineer"
},
{
"[email protected]": {
"email": "[email protected]",
"name": "Elliot",
"position": "Software Engineer"
}
]
}

24 changes: 5 additions & 19 deletions frontend/public/data/info/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
"contact": {
"address": {
"faIcon": "fa-solid fa-city",
"href": null,
"href": "",
"id": "address",
"value": "123 Main Street, Cupertino, CA 01234",
"value": "1440 Wake Forest Drive, Davis CA",
"valueShort": "Cupertino, CA 01234"
},
"email": {
"faIcon": "fa-solid fa-envelope",
"href": "mailto:[email protected]",
"id": "email",
"value": "[email protected]",
"valueShort": "[email protected]"
},
"facebook": {
Expand Down Expand Up @@ -46,28 +45,15 @@
"faIcon": "fa-solid fa-phone",
"href": "tel:1234567890",
"id": "phone",
"value": "+1 (123) 456-7890",
"valueShort": "(123) 456-7890"
"value": "+1 (123) 456-7890"
}
},
"locales": {
"en": {
"credits": "Designed by <strong><a class='light' href='https://github.com/ryanbalieiro'>Ryan Balieiro</a></strong>",
"role": "UX Designer"
},
"es": {
"credits": "",
"role": ""
},
"fr": {
"credits": "",
"role": ""
},
"zh": {
"credits": "",
"role": ""
"role": "Software Engineer"
}
},
"name": "Jonas ",
"name": "Jack Chen",
"profilePictureUrl": "images/pictures/avatar.png"
}
Loading

0 comments on commit 5021966

Please sign in to comment.