From aca81d97ec0c8d29d6bd7a8148490ab143d372f2 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 12 Jan 2016 09:05:32 +0100 Subject: [PATCH] Add Recipient destination model and functionality on front end --- front-ui/app/models/recipientDestination.js | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 front-ui/app/models/recipientDestination.js diff --git a/front-ui/app/models/recipientDestination.js b/front-ui/app/models/recipientDestination.js new file mode 100644 index 0000000..f38f137 --- /dev/null +++ b/front-ui/app/models/recipientDestination.js @@ -0,0 +1,22 @@ +var Backbone = require('backbone'); +var Globals = require('../globals'); + +var RecipientDestination = Backbone.Model.extend({ + + initialize: function() { + $.ajaxPrefilter( + function(options, originalOptions, jqXHR) { + options.xhrFields = { + withCredentials: true + } + } + ); + }, + + url: Globals.ApiUrl + '/cart/recipient_destination', + defaults: { + count: 0 + } +}); + +module.exports = RecipientDestination;