Skip to content

Commit

Permalink
let the linter do its thing
Browse files Browse the repository at this point in the history
  • Loading branch information
briangormanly committed Nov 29, 2023
1 parent 222e81a commit 9c80f47
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"homepage": "https://github.com/briangormanly/agora#readme",
"devDependencies": {
"eslint": "^8.25.0",
"eslint": "^8.54.0",
"nodemon": "^3.0.1"
}
}
6 changes: 3 additions & 3 deletions server/controller/apis/friendController.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ exports.getResources = async ( req, res ) => {
let friends = await friendService.getAllFriends( req.user.userId );
let requests = await friendService.getUnreadFriendRequests( req.user.userId );
let count = await friendService.getUnreadFriendRequestCount( req.user.userId );
resources.push(req.user, friends, requests, count);
resources.push( req.user, friends, requests, count );
res.set( "x-agora-message-title", "Success" );
res.set( "x-agora-message-detail", "Returned all user details" );
res.status( 200 ).json( resources );
Expand All @@ -63,7 +63,7 @@ exports.getResources = async ( req, res ) => {
res.set( "x-agora-message-detail", "User details not found" );
res.status( 400 ).json( message );
}
}
};

/*
//Get a specific friend, by their ID.
Expand Down Expand Up @@ -175,7 +175,7 @@ exports.rejectFriendRequest = async ( req, res ) => {

//Deletes a friend.
exports.deleteFriendByID = async ( req, res ) => {
let success = await friendService.deleteFriendByID( req.body.friendshipId);
let success = await friendService.deleteFriendByID( req.body.friendshipId );
if ( success ) {
res.set( "x-agora-message-title", "Success" );
res.set( "x-agora-message-detail", "Removed friend" );
Expand Down
4 changes: 2 additions & 2 deletions server/controller/apis/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const ApiMessage = require( '../../model/util/ApiMessage' );


exports.getUserByEmail = async function( req, res ) {
let user = await userService.getUserByEmail( req.params.email )
let user = await userService.getUserByEmail( req.params.email );
if ( user ) {
console.log(user);
console.log( user );
res.set( "x-agora-message-title", "Success" );
res.set( "x-agora-message-detail", "Returned user by email" );
res.status( 200 ).json( user );
Expand Down
4 changes: 2 additions & 2 deletions server/model/friendshipRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ exports.emptyFriendshipRequest = () => {
return new friendshipRequest();
};

exports.ormFriendshipRequest = function (row) {
exports.ormFriendshipRequest = function ( row ) {
let friendshipRequest = exports.emptyFriendshipRequest();
friendshipRequest.request_id = row.request_id;
friendshipRequest.requester_id = row.requester_id;
friendshipRequest.recipient_id = row.recipient_id;
friendshipRequest.request_time = row.request_time;
}
};
2 changes: 1 addition & 1 deletion server/routes/apiAuthRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ router.use( '/user', userRoutes );
*/

const friendRoutes = require( './apis/friendRoutes' );
router.use( '/friends', friendRoutes);
router.use( '/friends', friendRoutes );

/**
* Discussion APIs
Expand Down
8 changes: 4 additions & 4 deletions server/routes/apis/friendRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ router.route( '/sendFriendRequest' )
router.route( '/getResources' )
.get( async ( req, res ) => {
friendController.getResources( req, res );
})
} );

router.route( '/requestResponse' )
.post( async ( req, res ) => {
Expand All @@ -51,11 +51,11 @@ router.route( '/getFriend/:userID' )
//get a friend by their user ID.
.get( async ( req, res ) => {
friendController.getFriendByID( req, res );
} )
} );

router.route( '/deleteFriend' )
.delete( async ( req, res ) => {
friendController.deleteFriendByID( req, res );
} );
friendController.deleteFriendByID( req, res );
} );

module.exports = router;
4 changes: 2 additions & 2 deletions server/service/friendService.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ exports.getAllFriends = async ( userID ) => {

exports.getUnreadFriendRequestCount = async ( userID ) => {
let text = `SELECT COUNT(*) FROM friendships WHERE recipient_id = $1 AND friendship_status = $2`;
let values = [ userID, 'pending'];
let values = [ userID, 'pending' ];

try{
let res = await db.query( text, values );
if ( res.rows.length > 0){
if ( res.rows.length > 0 ){
return res.rows;
}
else{
Expand Down

0 comments on commit 9c80f47

Please sign in to comment.