Skip to content

Commit

Permalink
Update JSDocs on Favourites
Browse files Browse the repository at this point in the history
  • Loading branch information
sonufrienko committed Nov 6, 2019
1 parent d73c84f commit 05aa656
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions services/favourites.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { logger } from 'utils/logs';

/**
* Retrieve all favourites items of the user
* @param {*} token User's token
* Check out the API docs for this endpoint {@link https://resource-watch.github.io/doc-api/index-rw.html#get-favorites|here}
* @param {String} token User's token
*/
export const fetchFavourites = (token) => {
logger.info('Fetch favourites');
Expand All @@ -31,9 +32,10 @@ export const fetchFavourites = (token) => {

/**
* Creates a new favourite item attached to the current user
* @param {*} token User's token
* @param {*} resourceId Id of the resource
* @param {*} resourceType Resource's type (can be dataset, layer or widget)
* Check out the API docs for this endpoint {@link https://resource-watch.github.io/doc-api/index-rw.html#create-favorite|here}
* @param {String} token User's token
* @param {Object} options resourceId - Id of the resource,
* resourceType - resource's type (can be dataset, layer or widget)
*/
export const createFavourite = (token, { resourceId, resourceType }) => {
logger.info('Create favourite');
Expand All @@ -54,8 +56,9 @@ export const createFavourite = (token, { resourceId, resourceType }) => {

/**
* Deletes an existing favourite item attached to the current user
* @param {*} token User's token
* @param {*} resourceId Id of the resource
* Check out the API docs for this endpoint {@link https://resource-watch.github.io/doc-api/index-rw.html#delete-favorite|here}
* @param {String} token User's token
* @param {String} resourceId Id of the resource
*/
export const deleteFavourite = (token, resourceId) => {
logger.info(`Delete favourite ${resourceId}`);
Expand Down

0 comments on commit 05aa656

Please sign in to comment.