Skip to content

Commit

Permalink
Fix Kuksa parameters to match with new response (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
paularintaharri authored Mar 29, 2023
1 parent 78b6fc3 commit 6c003cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ module.exports.configurePassport = async (clientUrl) => {
)

let ageGroup = 4 //Sudenpennut
if (memberData.age_groupId !== null) {
ageGroup = memberData.age_groupId
if (memberData.ageGroupId !== null) {
ageGroup = memberData.ageGroupId
}

scout.canMarkDone = !restrictedAgeGroups.includes(ageGroup)
Expand Down
8 changes: 4 additions & 4 deletions src/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function getMemberData(groupMembers) {
{},
{
memberId: groupMember.id.id,
isGroupLeader: groupMember.is_leader,
isGroupLeader: groupMember.isLeader,
memberName:
groupMember.name.firstname + ' ' + groupMember.name.lastname,
memberTasks: taskEntries,
Expand Down Expand Up @@ -60,17 +60,17 @@ async function getAllGroups(userNumber) {
const memberData = await getMemberData(groupMembers)
const ageGroupId =
(memberData[0] &&
(await getMember(memberData[0].memberId)).age_groupId) ||
(await getMember(memberData[0].memberId)).ageGroupId) ||
4
return Object.assign(
{},
{
id: group.id,
name: group.name,
ageGroup: groupInfo.age_groups[0],
ageGroup: groupInfo.ageGroups[0],
ageGroupId,
troop: groupInfo.troops.filter(
(troop) => troop.id === member.default_troop_id
(troop) => troop.id === member.defaultTroopId
),
members: memberData,
}
Expand Down
8 changes: 4 additions & 4 deletions src/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export async function getProfile(userNumber) {
{},
{
name: `${member.name.firstname} ${member.name.lastname}`,
defaultTroopId: member.default_troop_id,
ageGroupId: member.age_groupId || 4,
ageGroup: member.age_group || 'Sudenpennut',
defaultTroopId: member.defaultTroopId,
ageGroupId: member.ageGroupId || 4,
ageGroup: member.ageGroup || 'Sudenpennut',
language: 'fi',
troops: member.troops,
isLeader: member.is_leader || false,
isLeader: member.isLeader || false,
image: memberImage,
}
)
Expand Down

0 comments on commit 6c003cb

Please sign in to comment.