updateFavoriteStatus(userId, itemId, isFavorite) {

        if (!userId) {
            throw new Error("null userId");
        }

        if (!itemId) {
            throw new Error("null itemId");
        }

        const url = this.getUrl(`Users/${userId}/FavoriteItems/${itemId}`);

        const method = isFavorite ? "POST" : "DELETE";

        return this.ajax({
            type: method,
            url,
            dataType: "json"
        });
    }
/**
     * Updates a user's favorite status for an item.
     * @param {String} userId
     * @param {String} itemId
     * @param {Boolean} isFavorite
     */
Updates a user's favorite status for an item.
Updates a user ' s favorite status for an item .
updateFavoriteStatus(userId, itemId, isFavorite) {
        if (!userId) {
            throw new Error("null userId");
        }
        if (!itemId) {
            throw new Error("null itemId");
        }
        const url = this.getUrl(`Users/${userId}/FavoriteItems/${itemId}`);
        const method = isFavorite ? "POST" : "DELETE";
        return this.ajax({
            type: method,
            url,
            dataType: "json"
        });
    }
updateFavoriteStatus ( userId , itemId , isFavorite ) { if ( ! userId ) { throw new Error ( "null userId" ) ; } if ( ! itemId ) { throw new Error ( "null itemId" ) ; } const url = this . getUrl ( ` ${ userId } ${ itemId } ` ) ; const method = isFavorite ? "POST" : "DELETE" ; return this . ajax ( { type : method , url , dataType : "json" } ) ; }
Updates a user's favorite status for an item.
Updates a user ' s favorite status for an item .