mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-23 22:44:06 +00:00
display user profile and company profile
This commit is contained in:
@@ -159,6 +159,10 @@ class AuthController extends Controller
|
||||
|
||||
return response()->json(['success'=> true, 'message'=> 'Profile updated.'], 200);
|
||||
}
|
||||
public function show()
|
||||
{
|
||||
return response()->json(['user' => Auth::user()]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -294,4 +298,6 @@ class AuthController extends Controller
|
||||
'success' => false, 'data'=> ['message'=> 'Invalid token or email or expired code']
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,6 +55,11 @@ class CompanyController extends Controller
|
||||
return response()->json(['success'=> true, 'message'=>'Company created successfully'],200);
|
||||
}
|
||||
|
||||
public function company()
|
||||
{
|
||||
return response()->json(['user' => Auth::user()]);
|
||||
}
|
||||
|
||||
public function companyProfile(Request $request)
|
||||
{
|
||||
$company = Company::where("user_id", Auth::user()->id)->first();
|
||||
|
||||
+42
-13
@@ -282,21 +282,12 @@
|
||||
<div class="form-row-group">
|
||||
|
||||
<div class="form-row no-padding">
|
||||
<label id="registration-no" type="text" class="form-element">Asif ferdous</label>
|
||||
<label id="user-name" type="text" class="form-element">Asif ferdous</label>
|
||||
</div>
|
||||
<div class="form-row no-padding">
|
||||
<label id="registration-no" type="text" class="form-element">ferdous.asif2012@gmail.com</label>
|
||||
<label id="user-phone" type="text" class="form-element">ferdous.asif2012@gmail.com</label>
|
||||
</div>
|
||||
<div class="form-row no-padding">
|
||||
<label id="registration-no" type="text" class="form-element">http://www.ferdous.com</label>
|
||||
</div>
|
||||
<div class="form-row no-padding">
|
||||
<label id="registration-no" type="text" class="form-element">CEO</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-divider"></div>
|
||||
|
||||
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
@@ -1295,7 +1286,45 @@
|
||||
document.getElementById("branchText7").value = document.getElementById(type).value.textContent = "Populate Contact Person";
|
||||
document.getElementById("branchText8").value = document.getElementById(type).value.textContent = "Populate Contact Person No";
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
headers:{"Authorization": "Bearer " + localStorage.getItem('token')},
|
||||
url : "api/user",
|
||||
contentType : "application/json",
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
console.log('success');
|
||||
$('#user-name').html(data.user.name);
|
||||
$('#user-phone').html(data.user.phone);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
headers:{"Authorization": "Bearer " + localStorage.getItem('token')},
|
||||
url : "api/company",
|
||||
contentType : "application/json",
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
console.log('success');
|
||||
$('#company-name').html(data.company.name);
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<!-- Change Header Title Acccording To The Tab Title End Here -->
|
||||
|
||||
<script src="js/jquery-3.2.1.min.js"></script>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
@@ -28,18 +28,7 @@
|
||||
<section class="container">
|
||||
<form>
|
||||
|
||||
<div class="form-row txt-center">
|
||||
<div class="profile-image">
|
||||
<div class="profile-image-com">
|
||||
<img id="CompanyProfile" class="avatar-img" src="images/Screenshot (9).png" width="80" height="80" />
|
||||
<label class="update-btn fix">
|
||||
<input id="CompanyUpload" type="file" style="display:none" />
|
||||
<i class="fa fa-camera"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-divider"></div>
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ Route::post('verify-phone', 'AuthController@verifyPhone');
|
||||
Route::group(['middleware' => ['jwt.auth']], function() {
|
||||
Route::get('logout', 'AuthController@logout');
|
||||
Route::patch('user', 'AuthController@updateUser');
|
||||
Route::get('user', 'AuthController@show');
|
||||
Route::get('test', function(Request $request){
|
||||
return response()->json(['user'=> $request->user()]);
|
||||
});
|
||||
@@ -46,8 +47,10 @@ Route::group(['middleware' => ['jwt.auth']], function() {
|
||||
|
||||
|
||||
/* Company */
|
||||
Route::get('/company', 'CompanyController@company');
|
||||
Route::patch('/company', 'CompanyController@update'); //update company information
|
||||
Route::post('/company/company_profile/', 'CompanyController@companyProfile');//upload company profile picture
|
||||
Route::post('/company/reg_cert/', 'CompanyController@regCert'); //upload registration certificaate
|
||||
Route::get('/delete/{id}', 'CompanyController@deletePost');
|
||||
});
|
||||
|
||||
|
||||
@@ -25,3 +25,7 @@
|
||||
//Route::post('login', 'AuthController@login');
|
||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
|
||||
Route::patch('/company', 'CompanyController@update'); //update company information
|
||||
Route::post('/company/company_profile/', 'CompanyController@companyProfile');//upload company profile picture
|
||||
Route::post('/company/reg_cert/', 'CompanyController@regCert'); //upload registration certificaate
|
||||
Route::get('/delete/{id}', 'CompanyController@deletePost');
|
||||
|
||||
@@ -35,6 +35,7 @@ class CompanyTest extends TestCase
|
||||
'company_name'=>'changed testing',
|
||||
'registration_no'=>'testing',
|
||||
'tax_no'=>'testing',
|
||||
'tax_no'=>'testing',
|
||||
'tel_no'=>'12345',
|
||||
'fax'=>'12345',
|
||||
'address'=>'testing',
|
||||
|
||||
Reference in New Issue
Block a user