Skip to content

Commit

Permalink
chore: rearrenging
Browse files Browse the repository at this point in the history
  • Loading branch information
esteban committed Jun 19, 2021
1 parent ddbf635 commit 4960121
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ app.get("/api/users/:username", async (req, res, next) => {
const { data: allUsersPlayInfo } = await axios.get(`${playServices.listAllUsers}`)
const { data: userNamePlayDetails } = await axios.get(`${playServices.detailUserName}${username}`)

// business logic
const isUserPlay = username => play => play.username === username
// https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-duplicates
const onlyUnique = (v, i, s) => s.indexOf(v) === i
const URIFactory = s => `/${URI}/${s}`


const allUserFriendsPromise = axios.get(`${friendsServices.listAll}`)
Expand Down Expand Up @@ -78,11 +83,6 @@ app.get("/api/users/:username", async (req, res, next) => {
Promise.allSettled(promises).
then((results) => console.log(results?.value));

// business logic
const isUserPlay = username => play => play.username === username
// https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-duplicates
const onlyUnique = (v, i, s) => s.indexOf(v) === i
const URIFactory = s => `/${URI}/${s}`

// generate header
const lazyBody = () => ({
Expand Down

0 comments on commit 4960121

Please sign in to comment.