Initial import
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
header('Content-type: application/json');
|
||||
$user = \app\services\Auth::getUserByToken();
|
||||
|
||||
|
||||
if($user) {
|
||||
$jsonData = Yii::$app->request->getRawBody();
|
||||
$data = json_decode($jsonData);
|
||||
|
||||
|
||||
if($data->status) {
|
||||
$user->club_card = $data->status == 'active' ? 1 : null;
|
||||
$user->save();
|
||||
}
|
||||
echo json_encode(['success'=> 1, 'profile' => $user->profileData()]);
|
||||
exit;
|
||||
}
|
||||
echo json_encode(['error' => 1, 'message' => 'Permission denied']);
|
||||
exit;
|
||||
Reference in New Issue
Block a user