Skip to content

fix(controllers): allow decline join request to remove outdated records #1630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Heroku CLI
- name: Install Koyeb CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/koyeb/koyeb-cli/master/install.sh | sh

- name: Checkout for release preparation
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -39,9 +39,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release

- name: Deploy API to Heroku
uses: akhileshns/heroku-deploy@e3eb99d45a8e2ec5dca08735e089607befa4bf28
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: sws2apps
heroku_email: ${{secrets.HEROKU_EMAIL}}
- name: Deploy API to Koeyb
env:
KOEYB_SERVICE_NAME: ${{ secrets.KOEYB_SERVICE_NAME }}
KOEYB_API_TOKEN: ${{ secrets.KOEYB_API_TOKEN }}
run: |
koyeb login --token $KOEYB_API_TOKEN
koyeb service redeploy $KOEYB_SERVICE_NAME
23 changes: 9 additions & 14 deletions .github/workflows/redeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Heroku CLI
- name: Install Koyeb CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/koyeb/koyeb-cli/master/install.sh | sh

- name: Checkout for release preparation
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: main
persist-credentials: false

- name: Deploy API to Heroku
uses: akhileshns/heroku-deploy@e3eb99d45a8e2ec5dca08735e089607befa4bf28
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: sws2apps
heroku_email: ${{secrets.HEROKU_EMAIL}}
- name: Deploy API to Koeyb
env:
KOEYB_SERVICE_NAME: ${{ secrets.KOEYB_SERVICE_NAME }}
KOEYB_API_TOKEN: ${{ secrets.KOEYB_API_TOKEN }}
run: |
koyeb login --token $KOEYB_API_TOKEN
koyeb service redeploy $KOEYB_SERVICE_NAME
11 changes: 1 addition & 10 deletions src/v3/controllers/congregation_admin_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ export const congregationDeleteUser = async (req: Request, res: Response) => {
return;
}

await UsersList.delete(user);
await foundUser.removeCongregation();

const cong_members = cong.getMembers(req.signedCookies.visitorid);

Expand Down Expand Up @@ -912,15 +912,6 @@ export const deleteJoinRequest = async (req: Request, res: Response) => {

const userId = req.headers.user as string;

const user = UsersList.findById(userId);

if (!user) {
res.locals.type = 'warn';
res.locals.message = 'no user record found with the provided id';
res.status(404).json({ message: 'error_app_join-requests-user-not-found' });
return;
}

await cong.declineJoinRequest(userId);

const result = congregationJoinRequestsGet(cong);
Expand Down