diff --git a/src/assets/scripts/profile/profile.controller.js b/src/assets/scripts/profile/profile.controller.js index 658f147..09eec0a 100644 --- a/src/assets/scripts/profile/profile.controller.js +++ b/src/assets/scripts/profile/profile.controller.js @@ -7,6 +7,8 @@ const ProfileController = ($scope, ProfileService, UserService) => { // Listen for event to do operations $scope.$on('loadUserSuccess', function (event, user) { $scope.user = user; + $scope.userUpdated = {}; + // Fetch user info for the profile ProfileService.fetchProfileService($scope.user.id) .then((result) => { @@ -22,27 +24,12 @@ const ProfileController = ($scope, ProfileService, UserService) => { * * v1.0 non selective update */ - $scope.updateProfile = (userUpdated) => { - ProfileService.updateUserProfile($scope.user.id) + $scope.updateProfile = () => { + ProfileService.updateUserProfile($scope.user.id, $scope.userUpdated) .then((result)=>{ - userUpdated.personal.first_name = "Jack" - userUpdated.personal.middle_name= "Francis" - userUpdated.personal.last_name= "Sparrow" - userUpdated.personal.bio = "Captain Jack Sparrow is a fictional character in the Pirates of the Caribbean film series. The character was created by screenwriters Ted Elliott and Terry Rossio, and is portrayed by Johnny Depp."; - userUpdated.personal.phone = 423123123 - userUpdated.personal.skills = ['Sailing', 'Robbing', 'Drinking'] - userUpdated.personal.main_classification = ['Captain'] - userUpdated.personal.languages = ['Rum', 'English'] - userUpdated.personal.nationality = "Unknown" - userUpdated.personal.dob = new Date(1987, 8, 1) - userUpdated.personal.address = "199 Eckford Street" - userUpdated.personal.city = "Spinachland" - userUpdated.personal.state = "VIC" - userUpdated.personal.postcode = 3149 - userUpdated.personal.education = "PhD" - userUpdated.personal.visa = "Temporary Skill Shortage visa (subclass 482)" - userUpdated.email = "jack@test" + console.log(result); }) + .catch((err)=> {console.log(err)}) } }); diff --git a/src/assets/scripts/profile/profile.html b/src/assets/scripts/profile/profile.html index 9d6c515..790dd25 100644 --- a/src/assets/scripts/profile/profile.html +++ b/src/assets/scripts/profile/profile.html @@ -1,4 +1,4 @@ -
+
@@ -18,359 +18,363 @@ -
+
-
{{ profile.name }}
+
{{ profile.name }}
Your Profile
- -
-
- First Name - -
-
- Middle Name - -
-
- Last Name - +
+
+
+ First Name + +
+
+ Middle Name + +
+
+ Last Name + +
-
-
-
- Email Address - -
-
- Phone Number - -
-
- State of residence in Australia - +
+
+ Email Address + +
+
+ Phone Number + +
+
+ State of residence in Australia + +
-
-
-
- Nationality - -
-
- Visa Type - -
-
- Language (Select one or more) - +
+
+ Nationality + +
+
+ Visa Type + +
+
+ Language (Select one or more) + +
-
-
+
Education - +
-
+
- +
-
Main Classification:
- +
Main Classification:
+
-
Skills:
- +
Skills:
+
@@ -379,52 +383,52 @@
Illustration
- +
-
- Twitter - -
-
- Facebook - -
-
- Instagram - -
-
- Linkedin - -
+
+ Twitter + +
+
+ Facebook + +
+
+ Instagram + +
+
+ Linkedin +
- -
-
- -
-
- - Curriculum - - - -
+
+
+ + +
+
-
+
+ Curriculum + + +
+
+
+
-
+
@@ -492,12 +496,13 @@
-
+
-
{{ profile.name }}
A global high-tech company and one of the key players in Aerospace, Defence and +
{{ profile.name }}
A global high-tech company and one of the key players in Aerospace, Defence + and Security
@@ -512,8 +517,7 @@
Business Type - +
ABN @@ -593,7 +597,7 @@
-
+
@@ -691,7 +695,7 @@
-
+
@@ -731,8 +735,7 @@
Website - +
@@ -827,4 +830,4 @@
-
+
\ No newline at end of file diff --git a/src/assets/scripts/profile/profile.service.js b/src/assets/scripts/profile/profile.service.js index 29cfac8..89cfbd9 100644 --- a/src/assets/scripts/profile/profile.service.js +++ b/src/assets/scripts/profile/profile.service.js @@ -8,9 +8,17 @@ const ProfileService = ($http) => { .catch( (error) => { return error; }); } - serv.updateUserProfile = (id) => { - return $http.get(`${process.env.RESTAPI_URL}/api/user/${id}`, { withCredentials: true }) - .then( (result) => { return result.data; }) + serv.updateUserProfile = (id, userUpdated) => { + return $http({ + method: 'POST', + url: `${process.env.RESTAPI_URL}/api/user/${id}`, + data: userUpdated, + withCredentials: true + }) + .then( (result) => { + console.log(result.data); + return result.data; + }) .catch( (error) => { return error; }); } return serv;