added the company profile frontend integration

This commit is contained in:
Aqeeb Imtiaz Harun
2018-06-01 09:58:27 +08:00
parent d1023faeb4
commit e6b08a6cba
2 changed files with 14 additions and 7 deletions
+13 -6
View File
@@ -134,17 +134,22 @@
<script type="text/javascript">
$(document).ready(function() {
$('#regCert').click(function() {
var fd = new FormData();
var files = $('#reg_cert')[0].files[0];
fd.append('reg_cert',files);
$.ajax({
type: "POST",
url: "api/company/reg_cert/5",
data: {
file:new FormData(this),
},
url: "api/company/reg_cert/",
headers: {"Authorization": 'Bearer' + localStorage.getItem('token')},
data:fd,
// {
// file:new FormData(this),
// },
contentType: false,
cache: false,
processData: false,
success: function(data) {
alert("success");
alert("Upload successful");
},
error: function() {
alert("Login Failed");}
@@ -153,8 +158,9 @@
$('#companyDetails').click(function() {
$.ajax({
type: "POST",
type: "PATCH",
url: "api/company",
headers: {"Authorization": 'Bearer' + localStorage.getItem('token')},
data: {
company_name: $('#company-name').val(),
registration_no: $('#registration-no').val(),
@@ -170,6 +176,7 @@
},
success: function(data) {
alert("success");
document.location.href="home.html";
},
error: function() {
alert("Login Failed");}
+1 -1
View File
@@ -109,7 +109,7 @@
password_confirmation:$('#password_confirmation').val()
},
success: function(data) {
document.location.href="index.html";
document.location.href="company-profile.html";
},
error: function() {
alert("Failed");}