guardian / path-manager

Service that manages paths for a domain. Ensures they are unique etc.
2 stars 0 forks source link

rework alias path removal into DELETE & POST endpoints #45

Closed twrichards closed 4 years ago

twrichards commented 4 years ago

https://github.com/guardian/path-manager/pull/39 introduced the concept of the isRemoved flag on alias paths along with a single POST /paths/aliasPathIsRemoved endpoint for modifying this, which I've never been particularly comfortable with.

What does this change?

This PR refactors that into a more nicely named /aliasPath?path=ALIAS_PATH endpoint which supports...

... neither take a body, and both return the updated list of alias PathRecords.

Note I had hoped to do this with a PATCH endpoint (which would be the most 'RESTful' way), however this was not possible, see https://github.com/guardian/path-manager/pull/44#issuecomment-717297830.

How to test

Unless you have path-manager set-up locally with some alias paths (in which case it's self explanatory to test, then it's easiest to test in CODE via the testing instructions in https://github.com/guardian/flexible-content/pull/3685 (which is the refactor PR to mirror this PR).

How can we measure success?

No notable 'success' to speak of, more just clean-up of some sub-optimal naming and API structure.

Have we considered potential risks?

This is not being actively used anywhere yet, so minimal risk.

Images

N/A