Skip to content

Added api route to get ssf contact for pantry #8

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

Closed
wants to merge 7 commits into from

Conversation

nadishiro17
Copy link

ℹ️ Issue

Get SSF Contact Name for Pantry

📝 Description

  1. Added a new API route /pantries/:pantryId/ssf-contact to retrieve the SSF contact details (name, email) for a specific pantry.
  2. Integrated this route into UsersController, with the business logic handled in UsersService.
  3. Implemented getSSFContactByPantryId method in UsersService to query the database and return the SSF representative details for the requested pantry.

Copy link

@fanzzz368 fanzzz368 left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link

@sam-schu sam-schu left a comment

Choose a reason for hiding this comment

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

Is the route supposed to be /api/users/pantries/{pantryId}/ssf-contact? This feels a bit confusing to me having both users and pantries.

Copy link

Choose a reason for hiding this comment

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

For me, the request does not work unless I remove both the interceptor decorator from the controller and the AuthGuard decorator from the new controller function.

Choose a reason for hiding this comment

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

I agree that the path is confusing. Maybe something like users/ssf-contact/{pantryId}?

@@ -27,4 +27,10 @@ export class UsersController {
removeUser(@Param('id') id: string) {
return this.usersService.remove(parseInt(id));
}

@UseGuards(AuthGuard('jwt'))
@Get('/pantries/:pantryId/ssf-contact')

Choose a reason for hiding this comment

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

Maybe it would make more sense to put this route under a pantries controller so that the path is just /pantries/{pantryId}/ssf-contact instead of with the users/ prefix? I know that this is getting a user in the end but the representative is kind of like an attribute of a specific pantry that we query for

@nadishiro17 nadishiro17 force-pushed the feature/get-pantry-contact branch from 508d3b8 to fbd25a3 Compare February 5, 2025 23:07
@fanzzz368 fanzzz368 closed this Apr 27, 2025
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.

4 participants