serokell / coffer

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

[#111] Correct endpoints results in Web API #112

Closed DK318 closed 2 years ago

DK318 commented 2 years ago

Description

Problem

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).

Solution

Changed endpoints results to Entry | Directory. Some changes demanded changes in CLI.Types (e.g. returning Entry instead of EntryPath).

Related issue(s)

Fixed #

:white_check_mark: Checklist for your Pull Request

Related changes (conditional)

Stylistic guide (mandatory)

DK318 commented 2 years ago

Isn't that a little bit confusing that we put Entry (an entire object) inside QualifiedPath (a path to the object)?

A little, but it reduces code in copy/rename functions

sancho20021 commented 2 years ago

Isn't that a little bit confusing that we put Entry (an entire object) inside QualifiedPath (a path to the object)?

A little, but it reduces code in copy/rename functions

Oh I now saw that we are going to get rid of QualifiedPath in WebAPI due to Issue 113. Soo it will either be rewritten, right?

DK318 commented 2 years ago

Oh I now saw that we are going to get rid of QualifiedPath in WebAPI due to https://github.com/serokell/coffer/issues/113. Soo it will either be rewritten, right?

I think no because these QualifiedPath Entry are used in Commands.hs and CLI.