serokell / coffer

Multi-backend password store with multiple frontends
4 stars 2 forks source link

Correct endpoints results in Web API #111

Closed DK318 closed 2 years ago

DK318 commented 2 years ago

Blocked by #83.

Clarification and motivation

At this moment in Web API in all endpoints (except for find) we return the corresponding result from CLI.Types. But it seems not correct, because these results contain both success and errors. And API should return only success results (error results return in corresponding handlers. See #99).

Endpoints that create resources should return Entry. For e.g. /create endpoint should return Entry instead of CreateResult.

Endpoints that modify resources should return that modified resource. For e.g. /set-field endpoint should return Entry and /copy endpoint should return Directory.

Acceptance criteria

All Web API endpoints return Entry or Directory results.