Skip to content

Collections users drew#1554

Draft
LouisThedroux wants to merge 49 commits into
collectionsfrom
collections-users-drew
Draft

Collections users drew#1554
LouisThedroux wants to merge 49 commits into
collectionsfrom
collections-users-drew

Conversation

@LouisThedroux
Copy link
Copy Markdown
Contributor

@LouisThedroux LouisThedroux commented Jun 4, 2025


Description

The purpose of the branch was to enable adding bulk members to collections.

This pull request was originally created as a quick fix for Annika to address critical survey page rendering issues in the collections-users branch. The primary intention was to resolve immediate problems, not to serve as a long-term solution or main development branch. However, as fixes accumulated, this branch was adopted as the main workstream for related survey and member management improvements. The branch will now be merged into collections, superseding its original purpose.

Summary of Original Changes (June 4, 2025)

  • Created an invite survey members page that calls forms to handle selecting surveys and members

  • Added POST Endpoint for Adding Members
    Introduced a dedicated endpoint to add survey members in bulk to more than one survey

  • Validation Update – Members and surveys Required
    Enforced “members” and "surveys" as required fields to resolve validation errors

  • Standalone Member Addition Logic ??
    Refactored member addition so it no longer relies solely on a fetch method within the API call. This now targets the correct port (7100 for app, not 6100), improving reliability and avoiding cross-port issues.

Next Steps

  • Snackbar messages for when members cannot be added (if member is already in survey, api post request fails but no messages pop up).
  • There is no functionality to delete members from a survey. Not sure if the endpoint even exists right now and may need some degree of cascading logic to tidy things up (maybe not actually)
  • Need to add index.test for paths\survey\members\index.ts
  • delete branch collections-users

@LouisThedroux LouisThedroux self-assigned this Jun 4, 2025
@LouisThedroux LouisThedroux added Early Feedback Welcome PR is not finished, but early review feedback is welcomed Ready For Review PR is ready for review Feature branch A branch used for staging, which will later be merged into main. labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2025

@mauberti-bc
Copy link
Copy Markdown
Collaborator

Should this be merged into the collections branch or collections-users?

@LouisThedroux
Copy link
Copy Markdown
Contributor Author

@mauberti-bc

Should this be merged into the collections branch or collections-users?

collection-users. This was a branch I made to help Annika on the collection-users branch, which would then be pulled into collections.

}
},
responses: {
200: {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies that there is no response body for status 200, but your return (res.status(200).json(...) is indeed sending a response body.

const surveyMemberService = new SurveyMemberService(connection);
await surveyMemberService.postSurveyMembers(surveyId, members);
await connection.commit();
return res.status(200).json({ message: 'Members added successfully' });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace .json(...) with .send()

Comment thread api/src/paths/survey/members/index.ts Outdated
Comment thread api/src/paths/survey/{surveyId}/members/index.ts Outdated
Comment thread api/src/repositories/survey-member-repository.ts Outdated
Comment thread api/src/repositories/survey-member-repository.ts Outdated
Comment thread api/src/repositories/survey-member-repository.ts Outdated
Comment thread api/src/repositories/survey-member-repository.ts
@mauberti-bc
Copy link
Copy Markdown
Collaborator

Also make sure to check the sonarcloud issues when reviewing PRs
image

@LouisThedroux LouisThedroux added Do Not Merge PR should not be merged Early Feedback Welcome PR is not finished, but early review feedback is welcomed and removed Ready For Review PR is ready for review Feature branch A branch used for staging, which will later be merged into main. labels Sep 8, 2025
Comment thread api/src/paths/collection/{collectionId}/member/index.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

@LouisThedroux LouisThedroux added Ready For Review PR is ready for review and removed Do Not Merge PR should not be merged Early Feedback Welcome PR is not finished, but early review feedback is welcomed labels Sep 18, 2025
@dylanrogowsky-oxd dylanrogowsky-oxd marked this pull request as draft February 4, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants