UNPKG

gorsejs

Version:

TypeScript SDK for Gorse recommender system.

82 lines 2.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.userFeedbackByType = exports.userFeedbacks = exports.itemFeedbackByType = exports.itemFeedbacks = exports.upsertFeedbacks = exports.insertFeedbacks = exports.getFeedbacks = exports.getFeedbacksByType = exports.deleteFeedback = exports.getFeedback = void 0; function getFeedback(axios, { type, userId, itemId, cursorOptions }) { return axios .get(`/feedback/${type}/${userId}/${itemId}`, { params: cursorOptions, }) .then(({ data }) => { return data; }); } exports.getFeedback = getFeedback; function deleteFeedback(axios, { type, userId, itemId }) { return axios .delete(`/feedback/${type}/${userId}/${itemId}`) .then(({ data }) => { return data.RowAffected; }); } exports.deleteFeedback = deleteFeedback; function getFeedbacksByType(axios, { type, cursorOptions }) { return axios .get(`/feedback/${type}`, { params: cursorOptions, }) .then(({ data }) => { return data; }); } exports.getFeedbacksByType = getFeedbacksByType; function getFeedbacks(axios, options) { return axios .get(`/feedback`, { params: options, }) .then(({ data }) => { return data; }); } exports.getFeedbacks = getFeedbacks; function insertFeedbacks(axios, feedbacksList) { return axios .post(`/feedback`, feedbacksList) .then(({ data }) => { return data.RowAffected; }); } exports.insertFeedbacks = insertFeedbacks; function upsertFeedbacks(axios, feedbacksList) { return axios .put(`/feedback`, feedbacksList) .then(({ data }) => { return data.RowAffected; }); } exports.upsertFeedbacks = upsertFeedbacks; function itemFeedbacks(axios, itemId) { return axios .get(`/item/${itemId}/feedback`) .then(({ data }) => data); } exports.itemFeedbacks = itemFeedbacks; function itemFeedbackByType(axios, { itemId, feedbackType }) { return axios .get(`/item/${itemId}/feedback/${feedbackType}`) .then(({ data }) => data); } exports.itemFeedbackByType = itemFeedbackByType; function userFeedbacks(axios, userId) { return axios .get(`/user/${userId}/feedback`) .then(({ data }) => data); } exports.userFeedbacks = userFeedbacks; function userFeedbackByType(axios, { userId, feedbackType }) { return axios .get(`/user/${userId}/feedback/${feedbackType}`) .then(({ data }) => data); } exports.userFeedbackByType = userFeedbackByType; //# sourceMappingURL=feedback.js.map