Format
This commit is contained in:
@@ -79,13 +79,19 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
form {
|
form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
max-width: 250px;
|
border: 2px solid #AAAAAA;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 20px;
|
||||||
|
gap: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginForm input {
|
.loginForm input {
|
||||||
@@ -112,8 +118,6 @@ a {
|
|||||||
button {
|
button {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: 2px solid #606060;
|
border: 2px solid #606060;
|
||||||
margin: 10px;
|
|
||||||
width: 75px;
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
@@ -134,7 +138,6 @@ input {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
width: 95%;
|
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
color: white;
|
color: white;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -220,7 +223,6 @@ a:focus {
|
|||||||
.inputGroup {
|
.inputGroup {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
min-width: 500px;
|
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,6 +274,8 @@ p {
|
|||||||
color: #eeeeee;
|
color: #eeeeee;
|
||||||
font: 16px tahoma, sans-serif;
|
font: 16px tahoma, sans-serif;
|
||||||
min-width: 50px;
|
min-width: 50px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:focus {
|
:focus {
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ app.post("/setInfo", authenticate, async (req, res) => {
|
|||||||
.input("username", sql.VarChar, req.user.Username)
|
.input("username", sql.VarChar, req.user.Username)
|
||||||
.input("firstName", sql.NVarChar(50), firstName)
|
.input("firstName", sql.NVarChar(50), firstName)
|
||||||
.input("lastName", sql.NVarChar(50), lastName)
|
.input("lastName", sql.NVarChar(50), lastName)
|
||||||
.input("dob", sql.Date, dob)
|
.input("dob", sql.Date, dob || null)
|
||||||
.query(`
|
.query(`
|
||||||
UPDATE Users
|
UPDATE Users
|
||||||
SET FirstName = @firstName,
|
SET FirstName = @firstName,
|
||||||
@@ -235,7 +235,12 @@ app.post("/setInfo", authenticate, async (req, res) => {
|
|||||||
`);
|
`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
if (error.message.includes("failed for parameter 'dob'.")) {
|
||||||
|
res.status(500).json({ message: "Must input date of birth" })
|
||||||
|
return;
|
||||||
|
}
|
||||||
res.status(500).json({ message: "Update request failed" })
|
res.status(500).json({ message: "Update request failed" })
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var updatedUser = req.user;
|
var updatedUser = req.user;
|
||||||
|
|||||||
Reference in New Issue
Block a user