Skip to content

Commit

Permalink
fix: correctly save untick/tick team to silent
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Dec 12, 2021
1 parent 3dc6a2a commit 51c05c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/org-settings.tsx
Expand Up @@ -280,15 +280,15 @@ export default function orgSettings(
)
? 'checked="checked" '
: ''
}onclick="fetch(location.pathname, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ team: ${JSON.stringify(
}onclick="fetch(location.pathname, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ silentTeam: ${JSON.stringify(
team,
)
.replace(/'/g, "\\'")
// TODO " in name is replaced by '. Acceptable because not used, but should be fixed.
.replace(
/"/g,
"'",
)}, value: event.currentTarget.checked }) })" />`,
)}, value: !event.currentTarget.checked }) })" />`,
}}
/>
{team.name}
Expand Down Expand Up @@ -317,7 +317,7 @@ export default function orgSettings(
res.status(400).send('not ok');
return;
}
if (!req.body.key && !req.body.team) {
if (!req.body.key && !req.body.silentTeam) {
res.status(400).send('not ok');
return;
}
Expand Down Expand Up @@ -354,8 +354,8 @@ export default function orgSettings(
: {
[req.body.value ? '$push' : '$pull']: {
silentTeams: req.body.value
? req.body.team
: { id: req.body.team.id },
? req.body.silentTeam
: { id: req.body.silentTeam.id },
},
$setOnInsert,
},
Expand Down

0 comments on commit 51c05c2

Please sign in to comment.