Skip to content

Instantly share code, notes, and snippets.

@mattduggan
Last active October 2, 2017 17:01
Show Gist options
  • Save mattduggan/1b1d54ec1336b485cf1901c4b9c99cc1 to your computer and use it in GitHub Desktop.
Save mattduggan/1b1d54ec1336b485cf1901c4b9c99cc1 to your computer and use it in GitHub Desktop.
Feature Tour - Service API
(function() {
this.FeatureTourService = function() {
return {
getFeatureTours: function() {
return Yesware
.get("Request")
.request({
url: BASE + "api/v1/feature_tours/feature_tours",
type: "GET",
includeAuthToken: true
})
.then(function(response) {
return response.feature_tours;
})
.catch(function(reason) {
console.error(reason);
throw reason;
});
},
updateFeatureTour: function(featureTour) {
return Yesware
.get("Request")
.request({
url: BASE + "api/v1/feature_tours/feature_tours/" + featureTour.id,
type: "PUT",
includeAuthToken: true,
data: { feature_tour: featureTour }
})
.catch(function(reason) {
console.error(reason);
throw reason;
});
}
};
}
}).apply(Yesware);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment