Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addBook(book){
return this.http.fetch('books', {
method: 'post',
body: json(book)
})
.then(response => response.json())
.then(createdBook => {
return createdBook;
})
.catch(error => {
console.log('Error adding book');
});
}
addBook(book){
return this.http.fetch('books', {
method: 'post',
body: json(book)
})
.then(response => response.json())
.then(createdBook => {
return createdBook;
})
.catch(error => {
console.log('Error adding book');
});
}
addBook(book){
return this.http.fetch('books', {
method: 'post',
body: json(book)
})
.then(response => response.json())
.then(createdBook => {
return createdBook;
})
.catch(error => {
console.log('Error adding book');
});
}
addBook(book){
return this.http.fetch('books', {
method: 'post',
body: json(book)
})
.then(response => response.json())
.then(createdBook => {
return createdBook;
})
.catch(error => {
console.log('Error adding book.');
});
}
addBook(book){
return this.http.fetch('books', {
method: 'post',
body: json(book)
})
.then(response => response.json())
.then(createdBook => {
return createdBook;
})
.catch(error => {
console.log('Error adding book');
});
}
UIHttpService.prototype.patch = function (slug, body, headers) {
var _this = this;
if (headers === void 0) { headers = true; }
this.logger.info("patch [" + slug + "]");
return this.httpClient
.fetch(slug, {
method: 'patch',
body: aurelia_fetch_client_1.json(body),
mode: 'cors',
headers: this.__getHeaders(headers)
})
.then(function (resp) { return _this.__getResponse(resp); });
};
UIHttpService.prototype.put = function (slug, body, headers) {
UIHttpService.prototype.patch = function (slug, body, headers) {
var _this = this;
if (headers === void 0) { headers = true; }
this.logger.info("patch [" + slug + "]");
return this.httpClient
.fetch(slug, {
body: json(body),
headers: this.__getHeaders(headers),
method: "patch",
mode: "cors"
})
.then(function (resp) { return _this.__getResponse(resp); });
};
UIHttpService.prototype.put = function (slug, body, headers) {
UIHttpService.prototype.patch = function (slug, body, headers) {
var _this = this;
if (headers === void 0) { headers = true; }
this.logger.info("patch [" + slug + "]");
return this.httpClient
.fetch(slug, {
body: aureliaFetchClient.json(body),
headers: this.__getHeaders(headers),
method: "patch",
mode: "cors"
})
.then(function (resp) { return _this.__getResponse(resp); });
};
UIHttpService.prototype.put = function (slug, body, headers) {
private sendPaymentRequest(url, body) {
this.httpClient.fetch(url, {
method: 'PUT',
body: json(body)
})
.then(response => response.json())
.then(data => {
this.messageBus.publish(Events.PaymentSubmitted);
});
}
}
private sendGuestRequest (url, body) {
this.httpClient.fetch(url, {
method: 'PUT',
body: json(body)
})
.then(response => response.json())
.then(data => {
this.messageBus.publish(Events.GuestSubmitted);
});
}
}