mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 20:44:04 +00:00
fix update profile error
fix update profile frontend unauthorize
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Company extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = ['company_profile', 'reg_cert', 'company_name', 'registration_no', 'tax_no', 'tel_no', 'fax', 'address', 'city', 'postcode', 'state', 'country', 'contact_person'];
|
||||
protected $fillable = ['user_id', 'company_profile', 'reg_cert', 'company_name', 'registration_no', 'tax_no', 'tel_no', 'fax', 'address', 'city', 'postcode', 'state', 'country', 'contact_person'];
|
||||
//protected $guarded = [];
|
||||
|
||||
public function user()
|
||||
|
||||
@@ -149,8 +149,9 @@ class AuthController extends Controller
|
||||
|
||||
// TODO : create company for user
|
||||
$company = new Company;
|
||||
$company->user = $user;
|
||||
$company->user_id = $user->id;
|
||||
$company->save();
|
||||
|
||||
|
||||
return response()->json(['success'=> true, 'message'=> 'Profile updated.']);
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
token: $('#verify-code').val()},
|
||||
success: function(data) {
|
||||
if( data.success){
|
||||
localStorage.token = data.token;
|
||||
document.location.href="profile-first-setup.html";
|
||||
localStorage.token = data.data.token;
|
||||
}
|
||||
else{
|
||||
console.log('wrong code');
|
||||
|
||||
Reference in New Issue
Block a user