change name action for api
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Read already defined users (pseudo-DB)
|
||||
const users = require('./auth/users.json');
|
||||
|
||||
const getUserFromDB = (userID) => {
|
||||
if (!userID) {return false;}
|
||||
|
||||
// Accessing 'DB'
|
||||
const user = users.find((user) => user.id === userID);
|
||||
|
||||
if (user) {
|
||||
return user;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {users, getUserFromDB}
|
||||
Reference in New Issue
Block a user