set up suppliers and manufactures to only have Bulk fielda and remove…#14
set up suppliers and manufactures to only have Bulk fielda and remove…#14thebascos wants to merge 1 commit into
Conversation
… the bulk checkbox and column
|
This PR was not deployed automatically as @thebascos does not have access to the Railway project. In order to get automatic PR deploys, please add @thebascos to the project inside the project settings page. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
| const isSuppManu = () => { | ||
| if ( | ||
| companyType === CompanyDTOTypeEnum.Supplier || | ||
| CompanyDTOTypeEnum.Manufacturer | ||
| ) { | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| }; |
There was a problem hiding this comment.
we can simplify this to just be
| const isSuppManu = () => { | |
| if ( | |
| companyType === CompanyDTOTypeEnum.Supplier || | |
| CompanyDTOTypeEnum.Manufacturer | |
| ) { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| }; | |
| const isSuppManu = () => { | |
| return companyType === CompanyDTOTypeEnum.Supplier || companyType === CompanyDTOTypeEnum.Manufacturer | |
| }; |
also, we can't just do:
companyType === CompanyDTOTypeEnum.Supplier || CompanyDTOTypeEnum.Manufacturerlike you had it because what that condition is saying is companyType === CompanyDTOTypeEnum.Supplier (which correctly checks if the company type is SUPPLIER) OR CompanyDTOTypeEnum.Manufacturer (which is just checking if this value is defined). instead, we need to do like in my suggestion above:
companyType === CompanyDTOTypeEnum.Supplier || companyType === CompanyDTOTypeEnum.Manufacturerthis way, we check if companyType === CompanyDTOTypeEnum.Supplier (which checks if company type is SUPPLIER) OR companyType === CompanyDTOTypeEnum.Manufacturer (which checks if company type is MANUFACTURER
| const isSuppManu = () => { | ||
| if ( | ||
| companyType === CompanyDTOTypeEnum.Supplier || | ||
| CompanyDTOTypeEnum.Manufacturer | ||
| ) { | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
also, since we reuse this logic, we can extract it to its own function. preferably, if you could extract this to its own custom hook, that would be great :). alternatively, you can also just extract it to a utility function and pass in the companyType as a parameter.
769b8cf to
6ce7327
Compare
44eb6b6 to
629cf3d
Compare
349106c to
bc4df5b
Compare
… the bulk checkbox and column
set up suppliers and manufactures to only have Bulk fielda and remove the bulk checkbox and column
Provide a description on what was changed/added/fixed in this PR
Checklist
First, create a draft pull request. Then mark the PR as ready for review when all necessary checkbox items has been completed
Backend only