Skip to content

feat(teams-board) Added team board support for all behaviour of a team board#94

Open
moffatethan wants to merge 8 commits into
feat-be-teamsfrom
feat-be-teams-boards
Open

feat(teams-board) Added team board support for all behaviour of a team board#94
moffatethan wants to merge 8 commits into
feat-be-teamsfrom
feat-be-teams-boards

Conversation

@moffatethan

Copy link
Copy Markdown
Contributor

What this PR does (required):

  • Inherits Board model and extends to add collaborators and admins to the board.
  • Added routes for adding, removing, and deleting a team board.
  • Creates reusable methods on the TeamBoard model for convenience for DRY codebase.
  • Cleans up controllers with DRY principles (error handling was repetitive)

Screenshots / Videos (required):

  • Will do a video walkthrough of the API (no front-end done)

Any information needed to test this feature (required):

  • Authenticate
  • Reference the teams_api_documentation.md to get started on creating a team

Any issues with the current functionality (optional):

  • While team boards can be set, the boards themselves live inside the boards collection as they are inherited on top of the board so board behaviour (adding columns, cards, etc) doesn't exist but adding members to a board does through the teams API.

@moffatethan moffatethan mentioned this pull request Jun 7, 2021

@jonmmyers jonmmyers left a comment

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.

Looks great. Nice job implementing the middleware to clean up the controllers!

Comment on lines +1 to +9
const asyncHandler = require("express-async-handler");
const { validationResult } = require("express-validator");

exports.checkForValidationErrors = asyncHandler(async (req, res, next) => {
const errors = validationResult(req);
if (!errors.isEmpty()) return next(errors);

return next();
});

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.

I see what you were getting at with using custom middleware to DRY up the error checking in the controllers!

Comment thread team_api_docs.md
**Content:** `{ error: "isAdmin must be a proper boolean" }`

- **Code:** 400 BAD REQUEST <br />
**Content:** `{ error: "Please provide a proper user id" }`

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.

Nice! Bringing the strong documentation game 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants