Skip to content

Change of path for favourites endpoint #11992

@offtherailz

Description

@offtherailz

Description

Actually MapStore uses the following endpoints for adding/removing from favorites

addFavoriteResource: (userId, resourceId, options) => {
const url = `/users/user/${userId}/favorite/${resourceId}`;
return axios.post(url, undefined, Api.addBaseUrl(parseOptions(options))).then((response) => response.data);
},
/**
* remove a resource from user favorites
* @param {string} userId user identifier
* @param {string} resourceId resource identifier
* @param {object} options additional axios options
*/
removeFavoriteResource: (userId, resourceId, options) => {
const url = `/users/user/${userId}/favorite/${resourceId}`;
return axios.delete(url, Api.addBaseUrl(parseOptions(options))).then((response) => response.data);
},

The path /users/user/${userId}/favorite/${resourceId} requires the userId that is not needed neither always present.

GeoStore needs to expose a dedicated path.

  • TODO: link here the geostore issue dedicated to this.

Endpoints proposed:

  • POST /users/user/favorite/${resourceId}
  • DELETE /users/user/favorite/${resourceId}

We are using here the same approach as per the endpoint /users/user/details that is currently available to the logged user to retrieve its details.

On mapstore side, as well as implemented on GeoStore, we need to use these 2 alternative paths to handle the functionality.

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Other useful information

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions