-
Notifications
You must be signed in to change notification settings - Fork 444
Description
Description
Actually MapStore uses the following endpoints for adding/removing from favorites
MapStore2/web/client/api/GeoStoreDAO.js
Lines 660 to 673 in 5beff13
| 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
Reactions are currently unavailable