Skip to content

Commit

Permalink
Edit logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaisa Korpela committed Oct 15, 2020
1 parent 63bda43 commit 813d897
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ async function getMemberData(groupMembers) {
}

function filterGroups(userNumber, groupsData) {
console.log('GROUPSDATA', groupsData)
return groupsData.filter(groupData => {
const groupMember = groupData.members.find(member => {
return member.memberId == userNumber
Expand All @@ -42,14 +41,16 @@ function filterGroups(userNumber, groupsData) {

async function getAllGroups(userNumber) {
const member = await getMember(userNumber)
console.log('MEMBER', member)
const memberGroups = await getGroupsFromKuksa(userNumber)
console.log('MEMBERGROUPS', memberGroups)
console.log('memberGroupsFromKuksa', memberGroups)
const groupAndMemberData = Promise.all(
memberGroups.groups.map(async group => {
const groupInfo = await getGroupInfo(userNumber, group.id)
console.log('getGroupInfo', groupInfo)
const groupMembers = await getGroupMembers(userNumber, group.id)
console.log('getGroupMembers', groupMembers)
const memberData = await getMemberData(groupMembers)
console.log('getMemberData', memberData)
const ageGroupId =
(memberData[0] &&
(await getMember(memberData[0].memberId)).age_groupId) ||
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ const main = async () => {
})

app.get('/groups', isLoggedIn, async (req, res) => {
console.log('getGroupsReqUser', req.user)
try {
const groups = await getGroups(req.user.membernumber)
console.log('GROUPS', groups)
res.json(groups).status(200)
} catch (e) {
res.status(e.statusCode).send(e.message)
Expand Down
1 change: 1 addition & 0 deletions src/kuksa.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const options = {
}

export async function getMember(memberId) {
console.log('memberIDKuksa', memberId)
const memberData = await request(
`${process.env.KUKSA}/members/${memberId}`,
options
Expand Down

0 comments on commit 813d897

Please sign in to comment.