Skip to content
This repository was archived by the owner on Mar 4, 2022. It is now read-only.

Commit 590eedd

Browse files
committed
Added typings for express user and added Lighthouse fixes to frontend
1 parent b1588cb commit 590eedd

File tree

10 files changed

+36
-18
lines changed

10 files changed

+36
-18
lines changed

backend/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ app.use(express.static(join(__dirname, '../frontend/build')));
8989
app.get('*', (req, res) =>
9090
res.sendFile(resolve(__dirname, '../frontend/build/index.html'))
9191
);
92-
server.listen(PORT, () => {
93-
console.log('CONFIG:', CONFIG, `\nListening on port: ${PORT}`);
94-
console.log(`Listening on port: ${PORT}`);
95-
});
92+
server.listen(
93+
PORT,
94+
() => console.log('CONFIG:', CONFIG, `\nListening on port: ${PORT}`)
95+
// console.log(`Listening on port: ${PORT}`)
96+
);

backend/routes/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ router.get('/', async (req, res, next) => {
2929
});
3030
if (!contains) sortBy = 'eventTime';
3131

32-
const conditions = hasPermission(req.user as IMemberModel, 'events')
32+
const conditions = hasPermission(req.user, 'events')
3333
? {}
3434
: { privateEvent: { $ne: true } };
3535

backend/routes/members.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ router.put('/:id', auth(), multer.any(), async (req, res, next) => {
120120
try {
121121
if (!ObjectId.isValid(req.params.id))
122122
return errorRes(res, 400, 'Invalid member ID');
123-
if (!memberMatches(req.user as any, req.params.id))
123+
if (!memberMatches(req.user, req.params.id))
124124
return errorRes(
125125
res,
126126
401,

backend/typings/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { IMemberModel } from '../models/member';
2+
3+
declare global {
4+
namespace Express {
5+
interface User extends IMemberModel {}
6+
}
7+
}

frontend/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<title>Purdue Hackers</title>
1313

1414
<meta name="author" content="Purdue Hackers">
15-
<meta name="description" content="">
16-
<meta name="keywords" content="college, university, purdue, hackers, member, members, membership, events, hackathon, hack-a-thon, mlh, boilermake, boilermaker, anvil, boilercamp, lafayette, lawson, LWSN, computer, science">
15+
<meta name="description" content="Purdue Hackers is a group of students who like having fun with computers and technology. We do not use hacking to mean 'cracking security systems.' Only movies do that.">
16+
<meta name="keywords" content="college, university, purdue, hackers, member, members, membership, events, hackathon, hack-a-thon, mlh, boilermake, boilermaker, anvil, boilercamp, lafayette, lawson, LWSN, computer, science, launchpad, ignite, sponsor, sponsorship">
1717

1818
<!-- Bootstrap CSS -->
1919
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"

frontend/public/robots.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow:

frontend/src/components/Edit-CreateEvent/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ const mapStateToProps = state => ({
328328
...state.sessionState
329329
});
330330

331-
export default connect(mapStateToProps, { flash: sendFlashMessage, clear: clearFlashMessages })(
332-
EditEventPage
333-
);
331+
export default connect(
332+
mapStateToProps,
333+
{ flash: sendFlashMessage, clear: clearFlashMessages }
334+
)(EditEventPage);

frontend/src/components/EditProfile/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,11 @@ const mapStateToProps = state => ({
555555
...state.sessionState
556556
});
557557

558-
export default connect(mapStateToProps, {
559-
flash: sendFlashMessage,
560-
clear: clearFlashMessages,
561-
updateProfile
562-
})(EditProfilePage);
558+
export default connect(
559+
mapStateToProps,
560+
{
561+
flash: sendFlashMessage,
562+
clear: clearFlashMessages,
563+
updateProfile
564+
}
565+
)(EditProfilePage);

frontend/src/components/Home/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export default () => (
5353
technology to create kick-ass projects.
5454
</p>
5555
<h3>
56-
I missed the callout!<br />Can I still join?
56+
I missed the callout!
57+
<br />
58+
Can I still join?
5759
</h3>
5860
<p>
5961
Absolutely! You can find all of our events in the Purdue Hackers
@@ -63,7 +65,8 @@ export default () => (
6365
target="_blank"
6466
>
6567
facebook group
66-
</a>. No prior knowledge or experience is needed, so come say hi!
68+
</a>
69+
. No prior knowledge or experience is needed, so come say hi!
6770
</p>
6871
<h3>What if I can&#39;t code?</h3>
6972
<p>

frontend/src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@font-face {
22
font-family: MontserratLite;
3+
font-display: auto;
34
src: url('./assets/fonts/Montserrat-Light.otf');
45
}
56

0 commit comments

Comments
 (0)