Skip to content

Return more information from the preserved route endpoints #34

@incognitojam

Description

@incognitojam

Sometimes a route being preserved can cause confusion when it was preserved automatically or by an admin.

Currently GET /v1/devices/:dongleId/routes/preserved returns the list of preserved routes for a dongle and user. The API returns a 403 error when trying to DELETE /v1/route/:routeId/preserve a route that was preserved by another user. The same error code is used when the user has preserved too many routes (10, or 100 for prime users), so clients cannot tell the difference easily.

Some potential solutions:

  1. Differentiating the error code or adding an error message to the /v1/route/:routeId/preserve endpoint so that clients can tell the difference between the two errors.
  2. Returning whether the user or someone else preserved the route in the API response to GET /v1/devices/:dongleId/routes/preserved. This would allow the client to disable the preserve button altogether.
  3. Excluding routes preserved by admins from the list returned by GET /v1/devices/:dongleId/routes/preserved. This might be more difficult to implement since you would want to keep track of separate RoutePreserved entries by the user and admins for each route, but would completely hide this behaviour from the users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions