mirror of
https://github.com/arnaucube/commonroutesApp.git
synced 2026-02-08 03:56:41 +01:00
post new offering travel, and user page
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
angular.module('app.offerCar', ['pascalprecht.translate'])
|
||||
|
||||
.controller('OfferCarCtrl', function($scope, $stateParams, $translate, $filter) {
|
||||
.controller('OfferCarCtrl', function($scope, $stateParams, $translate,
|
||||
$http, $filter) {
|
||||
|
||||
$scope.newtravel={};
|
||||
$scope.createTravel =function(){
|
||||
$scope.newtravel.type="offering";
|
||||
$http({
|
||||
url: urlapi + 'travels',
|
||||
method: "POST",
|
||||
data: $scope.newtravel
|
||||
})
|
||||
.then(function(data) {
|
||||
console.log(data);
|
||||
window.location="#app/travels"
|
||||
},
|
||||
function(data) { // optional
|
||||
// failed
|
||||
console.log(data);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user