You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to at some point be using Rest properly. Currently, this is not the case. Each endpoint which deviates from REST patterns should be duplicated and corrected. We can later migrate the frontend over to the correct endpoint and delete the incorrect usage. We don't need to be super strict but just better than where we are now.
Our current url POST /v1/partner/delete does not make sense. Firstly, this is because functionally it is a soft delete. We merely set the status of the partner from active to inactive. Secondly the usage of POST is incorrect.
Action Items
See /bloom-backend/src/partner/partner.controller.ts. Look for the POST /v1/partner/delete endpoint. We want to replicate the functionality of this endpoint.
We want this url to be a PATCH request with the url /v1/partner/:id and with a body that accepts {active: boolean} .
You will also need to create a new service method with a different name. Instead of deletePartner, it should be updatePartner. updatePartner should take both the partnerId and a body DTO which all the changes inside. Please see bloom-backend/src/partner-feature/partner-feature.service.ts. Look at updatePartnerFeature as an example.
Please feel free to delete the old version.
Create a test file with a new test for the new service method. It would be good to cover the pass and fail scenario.
Resources/Instructions
the bloom-backend/src/partner-feature/partner-feature.service.ts folder is a better example of how we want our controllers and services to be structured. Take a look at those so you have an understanding of our preferred patterns.
The text was updated successfully, but these errors were encountered:
Thank you for your interest in contributing to Chayn! Please carefully read the CONTRIBUTING.md file and the README.md file for guidance. Let us know if you have any questions. Good luck!
Overview
We want to at some point be using Rest properly. Currently, this is not the case. Each endpoint which deviates from REST patterns should be duplicated and corrected. We can later migrate the frontend over to the correct endpoint and delete the incorrect usage. We don't need to be super strict but just better than where we are now.
Our current url POST
/v1/partner/delete
does not make sense. Firstly, this is because functionally it is a soft delete. We merely set the status of the partner from active to inactive. Secondly the usage of POST is incorrect.Action Items
/v1/partner/delete
endpoint. We want to replicate the functionality of this endpoint./v1/partner/:id
and with a body that accepts{active: boolean}
.deletePartner
, it should beupdatePartner
.updatePartner
should take both the partnerId and a body DTO which all the changes inside. Please see bloom-backend/src/partner-feature/partner-feature.service.ts. Look atupdatePartnerFeature
as an example.Resources/Instructions
The text was updated successfully, but these errors were encountered: