herbsjs / herbs2rest

Create a REST API based on HerbsJS
MIT License
2 stars 13 forks source link

Usecase should have access to req.user inside ctx #42

Closed vitorgamer58 closed 2 years ago

vitorgamer58 commented 2 years ago

Feature https://github.com/herbsjs/herbs2rest/issues/41

Proposed Changes

  1. Added injection in the defaultController function so that req.user data can be accessed within usecase steps through ctx.di

Readiness Checklist

Author/Contributor

Reviewing Maintainer

vitorgamer58 commented 2 years ago

Is working Usecase working

codecov[bot] commented 2 years ago

Codecov Report

Merging #42 (b87b441) into main (90cf623) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #42   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          129       132    +3     
=========================================
+ Hits           129       132    +3     
Impacted Files Coverage Δ
src/defaultController.js 100.00% <100.00%> (ø)
src/generateRoutes.js 100.00% <0.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

vitorgamer58 commented 2 years ago

Good PR @vitorgamer58, but I think the doc about this is missing

I'll work on this.

vitorgamer58 commented 2 years ago

@jhomarolo I'm not sure if I'm satisfied with the documentation of my feature, I believe the documentation needs a little more context about the req.user, maybe with some middleware example from express.

dalssoft commented 2 years ago

I dont think this PR makes sense anymore given https://github.com/herbsjs/buchu/pull/85

vitorgamer58 commented 2 years ago

I agree