Skip to content
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

[CHE-17] Create Backend Alumni Routes #45

Conversation

brok3turtl3
Copy link
Contributor

@brok3turtl3 brok3turtl3 commented Mar 16, 2024

Description

This ticket is part of CHE-15 Create Alumni Directory story and sets up the back end route and controller files including the initial get all alumni data route.

Jira Task

CHE-17

Testing Instructions

  1. git fetch
  2. git checkout CHE-17/subtask/Create-Backend-Alumni-Routes
  3. npm run docker-dev --> verify core functionality is present and navigation to the Directory page
    receives alumni data on the initial load (it will show in the console log for now)

Checklist

All Team Members

  • I added a descriptive title to this PR.
  • I filled out the Description, Jira Task, and Testing Instructions sections above.
  • I added or updated [Jest unit tests]for any changes to components, server-side controllers, etc.
  • I ran npm run docker-test in my local environment to check that this PR passes all unit tests.
  • I did a quick check to make sure my code changes follow the recomended style guide.

Additional Notes, Images, etc.

N/A

…lAlumniData controller and basic fetch test on Directory page
@brok3turtl3 brok3turtl3 changed the title CHE-17 Created alumni model, alumni type file, added routes and getAl… [CHE-17] Create Backend Alumni Routes Mar 16, 2024
@brok3turtl3 brok3turtl3 self-assigned this Mar 16, 2024
@brok3turtl3 brok3turtl3 added the enhancement New feature or request label Mar 16, 2024
@brok3turtl3 brok3turtl3 requested a review from seantokuzo March 16, 2024 19:50
@brok3turtl3 brok3turtl3 marked this pull request as ready for review March 16, 2024 19:50
import { useAppSelector } from "../../app/hooks";
import axios from "axios";
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if there would be value in creating custom axios instances where we could set reusable configs like baseUrl, withCredentials, headers etc. Could setup interceptors for responses too to simplify error handling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems interesting to me - Love to chat about error handling overall!

name: { type: String, trim: true, required: true },
email: { type: String, trim: true, required: true },
linkedIn: { type: String, trim: true },
campus: { type: String, trim: true },
Copy link
Contributor

Choose a reason for hiding this comment

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

could maybe set this up as an enum depending on how we parse the alumni sheet we're working with

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like use enums for some of the fields? Like campus? Maybe Im misunderstanding. Lets chat!

linkedIn: { type: String, trim: true },
campus: { type: String, trim: true },
cohort: {
type: Schema.Types.Mixed, //TODO Better way to do this? Spreadhsete has strings and numbers...
Copy link
Contributor

Choose a reason for hiding this comment

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

since the only non number are the PTRI 'beta' maybe we could just call them 0 and bypass the Mixed type. But also we should probably think of a way to validate campus+cohort# combos?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like convert the data as we parse it? That's probably doable but what if Codesmith decides to use that type naming again at some point?

@brok3turtl3 brok3turtl3 merged commit 7543e95 into CHE-15/story/Create-Alumni-Directory Mar 28, 2024
2 checks passed
@brok3turtl3 brok3turtl3 deleted the CHE-17/subtask/Create-Backend-Alumni-Routes branch March 28, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants