Conversation
|
See slack comment |
313c63d to
2577fbe
Compare
2577fbe to
265bad6
Compare
dburkhart07
left a comment
There was a problem hiding this comment.
Make these initial changes, also see message I sent you.
| yarn-error.log | ||
| testem.log | ||
| /typings | ||
| .nx |
There was a problem hiding this comment.
Why is this here? Can we get rid of it?
| pantries?: Pantry[]; | ||
| } | ||
|
|
||
| export interface UserDto { |
There was a problem hiding this comment.
This should not be deleted either I dont think.
…com/Code-4-Community/ssf into sk/SSF-97-pantry-management-backend
…k/SSF-97-pantry-management-backend
…com/Code-4-Community/ssf into sk/SSF-97-pantry-management-backend
dburkhart07
left a comment
There was a problem hiding this comment.
Few initial things. Also, I do not see the second half of the ticket requirement to make a new endpoint for this: Add a new endpoint to overwrite the set of volunteers assigned to a pantry with a new set of volunteers for intended use case
apps/backend/src/pantries/types.ts
Outdated
| email: string; | ||
| phone: string; | ||
| }; | ||
| refrigeratedDonation: string; |
apps/backend/src/pantries/types.ts
Outdated
| }; | ||
| refrigeratedDonation: string; | ||
| allergenClients: string; | ||
| status: string; |
| } | ||
|
|
||
|
|
||
| async getApprovedPantriesWithVolunteers(): Promise<ApprovedPantryResponse[]> { |
There was a problem hiding this comment.
See comment in the type.ts file, this will need to change too.
| return this.pantriesService.getPendingPantries(); | ||
| } | ||
|
|
||
| @Get('/approved') |
There was a problem hiding this comment.
We should write a test for this as well.
…com/Code-4-Community/ssf into sk/SSF-97-pantry-management-backend
dburkhart07
left a comment
There was a problem hiding this comment.
Just a few other small things and it should be good.
apps/backend/src/pantries/types.ts
Outdated
| export interface ApprovedPantryResponse { | ||
| pantryId: number; | ||
| pantryName: string; | ||
| address: { |
There was a problem hiding this comment.
Can we make this a bit clearer and call it shippingAddress
dburkhart07
left a comment
There was a problem hiding this comment.
Few more small things. Can you also fix both tests that are currently failing? I think one of these comments should fix one of them.
dburkhart07
left a comment
There was a problem hiding this comment.
Few final things. See slack message as well.
| ReserveFoodForAllergic, | ||
| ServeAllergicChildren, | ||
| } from './types'; | ||
| import { RefrigeratedDonation } from './types'; |
There was a problem hiding this comment.
nit: This should be grouped in with the above import on line 7-14
| newsletterSubscription: boolean; | ||
| } | ||
|
|
||
| export interface AssignedVolunteer { |
…k/SSF-97-pantry-management-backend
…k/SSF-97-pantry-management-backend
ℹ️ Issue 97
Closes 97
📝 Description
Added a new endpoint (getApprovedPantries) to return all information necessary for the pantry management frontend about pantries with 'approved' status - includes assigned volunteers.
Added a second new endpoint (updatePantryVolunteers) to overwrite the set of volunteers assigned to a pantry with a new set of volunteers.
Added a type file for pantries and included ApprovedPantryResponse and AssignedVolunteer types.
Added a controller test for each endpoint.
✔️ Verification
Tested both endpoints using curl. Made sure GET endpoint retrieved all approved pantries with assigned volunteers, and that the PUT endpoint overwrites volunteer assignments successfully.