From 8ba411cf2a0697e39ebe85ef9fe2671944c8b901 Mon Sep 17 00:00:00 2001 From: Pat Sabpisal Date: Wed, 19 Oct 2016 13:59:17 +0700 Subject: [PATCH] Removed url-mask --- app/js/controller.js | 6 ++++++ app/view/brand-profile.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/js/controller.js b/app/js/controller.js index 43e008f7..decb06ee 100644 --- a/app/js/controller.js +++ b/app/js/controller.js @@ -1531,6 +1531,10 @@ angular.module('reachRabbitApp.brand.controller', ['reachRabbitApp.service']) $scope.alert.danger(o.message); return; } + + if (profile.brand.website && profile.brand.website.length > 1 && !profile.brand.website.startsWith("http")) { + profile.brand.website = "http://" + profile.brand.website; + } AccountService.saveProfile(profile) .then(function (response) { @@ -1539,9 +1543,11 @@ angular.module('reachRabbitApp.brand.controller', ['reachRabbitApp.service']) if($scope.formData.brand.isCompany) { $scope.alreadyCompany = true; } + //set back to localstorage UserProfile.set(response.data); + $scope.form.$setPristine(); $scope.success = true; $scope.alert.success('บันทึกข้อมูลเรียบร้อย!'); diff --git a/app/view/brand-profile.html b/app/view/brand-profile.html index 36da069a..07e3b0c3 100644 --- a/app/view/brand-profile.html +++ b/app/view/brand-profile.html @@ -58,7 +58,7 @@

Profile ของฉัน

เว็บไซต์ของ Brand
- +