Skip to content

Conversation

@shaunwarman
Copy link
Member

Allow request body to honor _method property to override http method to DELETE and PUT where necessary.

relates to: ladjs/lad#395

@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

Merging #25 into master will decrease coverage by 0.13%.
The diff coverage is 83.33%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #25 +/- ## ========================================== - Coverage 84.13% 84.00% -0.14%  ========================================== Files 1 1 Lines 145 150 +5 ========================================== + Hits 122 126 +4  - Misses 23 24 +1 
Impacted Files Coverage Δ
index.js 84.00% <83.33%> (-0.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d360d7...f0f09cf. Read the comment docs.

@shaunwarman
Copy link
Member Author

updated @niftylettuce - can add method override similar to the below upstream (lad / FE / etc):

(req) => { const { _method } = req.body; if ( typeof _method !== 'string' && !['PUT', 'DELETE'].includes(_method) ) { throw new Error(`method override of ${_method} is not valid`); } return _method; }) 
@shaunwarman shaunwarman merged commit 5c4915b into ladjs:master Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant