ReflectionsProjections / rp-api-2023

Core Backend API Layer for Reflections | Projections 2023, powered by Nest.js
MIT License
0 stars 0 forks source link

Add initial checks for file type and size #38

Closed kajalpatelinfo closed 1 year ago

kajalpatelinfo commented 1 year ago

This PR adds checks for file type and size for uploads. It throws a 400 BadRequest when a file that does not adhere to these constraints is uploaded. It is beyond the scope of this PR to catch the Exception and handle it on the frontend.

The constraints are as follows.

github-actions[bot] commented 1 year ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
64.73% (-1.93% πŸ”»)
402/621
πŸ”΄ Branches
14.93% (-2.36% πŸ”»)
10/67
πŸ”΄ Functions
28.24% (-1.65% πŸ”»)
24/85
🟑 Lines
62.12% (-2.25% πŸ”»)
346/557
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------- | :------------------------------------------------------------- | :------------------------------------------------------------- | :-------------------------------------------------------------- | :-------------------------------------------------------------- | | πŸ”΄ |
`...` / wallet.service.ts
|
39.02% (-2% πŸ”»)
| 0% | 20% |
35.9% (-1.94% πŸ”»)
| | πŸ”΄ |
`...` / attendees.controller.ts
|
44.62% (-5.38% πŸ”»)
|
31.25% (-4.46% πŸ”»)
| 20% |
42.86% (-5.36% πŸ”»)
| | 🟑 |
`...` / events.controller.ts
|
68.97% (-9.61% πŸ”»)
|
0% (-50% πŸ”»)
|
14.29% (-19.05% πŸ”»)
|
66.67% (-11.11% πŸ”»)
|

Test suite run success

16 tests passing in 12 suites.

Report generated by πŸ§ͺjest coverage report action from 23ca04b0453e874e331f2e74a8d6e0bd813943a5

xuxey commented 1 year ago

Also good news -- The latest changes I pushed to the registration form will handle the frontend side of things :)