n-odata-server icon indicating copy to clipboard operation
n-odata-server copied to clipboard

How to write business logic on Entity creation?

Open siddiquipro opened this issue 6 years ago • 2 comments

While creating entity i want to add some business logic and also want to create related entities, Where can i update them ?

@htammen please help as it is important

siddiquipro avatar Nov 01 '18 10:11 siddiquipro

I think you can do this via: https://loopback.io/doc/en/lb3/Adding-application-logic.html . But i can't figure out how that worked with OData.

If you do so, please write me back!

maxwiese avatar May 29 '19 10:05 maxwiese

@mohammadsiddiqui Basically, what you need is not related to OData component. This is about how loopback's Models work.

I think you need to use "before create" or "persist" operation hooks. There you can do all the needed data manipulations.

andrii-naumovych avatar Jun 08 '19 14:06 andrii-naumovych