From 4960121abc76c0ca277a999455372457fe2e4235 Mon Sep 17 00:00:00 2001 From: esteban Date: Fri, 18 Jun 2021 23:54:53 -0500 Subject: [PATCH] chore: rearrenging --- server/app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/app.js b/server/app.js index ab34724..bbeb10a 100644 --- a/server/app.js +++ b/server/app.js @@ -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}`) @@ -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 = () => ({