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...
DELETE to mark the supplied ALIAS_PATH as removed
POST to 'restore' the supplied ALIAS_PATH that was previously marked as removed
... neither take a body, and both return the updated list of alias PathRecords.
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.
https://github.com/guardian/path-manager/pull/39 introduced the concept of the
isRemoved
flag on alias paths along with a singlePOST
/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...DELETE
to mark the suppliedALIAS_PATH
as removedPOST
to 'restore' the suppliedALIAS_PATH
that was previously marked as removed... neither take a body, and both return the updated list of alias
PathRecord
s.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