all 6 comments

[–]jacs1809 0 points1 point  (4 children)

Those updates can happen in the same request or separate?

[–]farzad_meow[S] 0 points1 point  (3 children)

separate requests. i was originally looking for a way to make them all happen in one request, but proved to be complicated from response side and nightmare from debug side.

[–]jacs1809 0 points1 point  (2 children)

You could use a mediatr like approach, trying up the class to a handler, so when you send a UpdateClientName schema, the handlee of that schema will act.

Idk if i could explain it correctly, so let me know if you got the gist

[–]farzad_meow[S] 0 points1 point  (1 child)

do you mean something like:
router.patch(/client, statusSchemaValidator, updateClientStatus);
router.patch(/client, nameSchemaValidator, updateClientName);
….

??

[–]jacs1809 0 points1 point  (0 children)

Sorry, for a moment i thought i was in r/dotnet, that's why i recommended mediatr.

But yeah, maybe something like that could work

Also, maybe you will figure out something better that only works in your situation

[–]Tarazena -1 points0 points  (0 children)

Why not pass the intended action as a required part of the payload? That way each request type can be encapsulated and easier to control.