Comments (4)
Is this a feature request?
Also, this is already as you said by overriding the respective method and calling your transform and the super method with the result of the transform.
Overriding also gives you the control of how to handle errors, while with the transform example you give this is not clear at all.
Can you elaborate what exactly is your pain point with overriding crud method, because to me the transform you propose doesn't seems like improvement?
from dataui-nestjs-crud.
transform()
is just a lightweight function to transform the body without registering class-based interceptors
from dataui-nestjs-crud.
Yes, I get that writing interceptors is too much or such a simple functionality.
But what about overriding ? Something like that:
@Crud({
model: { ... }
})
@Controller('example')
export class ExampleController {
constructor( public service: ExampleService,) {
}
@Override('createOneBase')
_createOneBase(
@ParsedRequest() req: CrudRequest,
@ParsedBody() dto: any,
): Promise<any> {
const newBody = transform(dto);
super.createOneBase(req, newBody)
}
from dataui-nestjs-crud.
@its-dibo Is the provided answer working for you?
I am closing the issue, please reopen it in case it is not.
from dataui-nestjs-crud.
Related Issues (20)
- BUG: Incorrect result on searching with combination "$and" + "$or" conditions HOT 1
- npm broken documentation links HOT 1
- Bug: GetMany with join + pagination throws duplicate column error HOT 1
- empty schema for the Entity HOT 8
- cannot set decorators globally
- Feature Request: Join Filter (ON clause) HOT 2
- Minor typo in main.yml: Docker Compose command HOT 1
- @Crud dynamic params and ManyToOne Relationships incorrect column mapping
- wrong typing HOT 2
- include soft deleted rows HOT 1
- extend CrudController HOT 2
- Tips: How to add customized filter conditions from backend service. HOT 2
- How to specify `operationId` for each route? HOT 1
- [help] how to add additional methods without overriding HOT 1
- Join Condition (on clause) not working as given in the docs HOT 2
- Support for GroupBy clause and Aggregate functions
- wrong Reflect method HOT 5
- export helpers and expose crudSwagger decorator HOT 2
- Is it possible to cascade soft delete with this library?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataui-nestjs-crud.