fixed bugs
This commit is contained in:
parent
4e30af1841
commit
5d08a44965
@ -311,7 +311,7 @@ class AuthController extends Controller
|
||||
}
|
||||
/**
|
||||
* @OA\Post(
|
||||
* path="/api/auth/confirmation-account",
|
||||
* path="/api/auth/activate-account",
|
||||
* summary="Confirm user account via email verification token",
|
||||
* tags={"Auth"},
|
||||
* @OA\RequestBody(
|
||||
@ -329,7 +329,7 @@ class AuthController extends Controller
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=401,
|
||||
* response=404,
|
||||
* description="Invalid token",
|
||||
* @OA\JsonContent(
|
||||
* @OA\Property(property="message", type="string", example="Your token is not valid")
|
||||
@ -356,7 +356,7 @@ class AuthController extends Controller
|
||||
]);
|
||||
$token = Token::existsTokenByToken($fields['token'], 'email_verification');
|
||||
if(!$token) {
|
||||
return response()->json(['message' => 'Your token is not valid'], 401);
|
||||
return response()->json(['message' => 'Your token is not valid'], 404);
|
||||
}
|
||||
$user = $token->user;
|
||||
$token->delete();
|
||||
|
||||
@ -14,7 +14,6 @@ class CategoryController extends Controller
|
||||
* path="/api/categories",
|
||||
* summary="Get all categories",
|
||||
* tags={"Categories"},
|
||||
* security={{"bearerAuth": {}}},
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="List of categories",
|
||||
|
||||
@ -26,6 +26,7 @@ class TestResource extends JsonResource
|
||||
* @OA\Items(ref="#/components/schemas/QuestionResource")
|
||||
* ),
|
||||
*
|
||||
* @OA\Property(property="is_available", type="boolean", example=true),
|
||||
* @OA\Property(property="author_id", type="integer", nullable=true, example=2),
|
||||
* @OA\Property(property="author", ref="#/components/schemas/UserResource"),
|
||||
*
|
||||
@ -46,6 +47,7 @@ class TestResource extends JsonResource
|
||||
|
||||
'questions' => QuestionResource::collection($this->whenLoaded('questions')),
|
||||
|
||||
'is_available' => $this->isAvailable(),
|
||||
'author_id' => $this->author_id,
|
||||
'author' => new UserResource($this->whenLoaded('author')),
|
||||
|
||||
|
||||
@ -427,13 +427,13 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/confirmation-account": {
|
||||
"/api/auth/activate-account": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"Auth"
|
||||
],
|
||||
"summary": "Confirm user account via email verification token",
|
||||
"operationId": "c8ecdf6fd50dc4c70fcc5bf19233e462",
|
||||
"operationId": "cc3ffe1c1268e54e33a68adc9731e7d3",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@ -470,7 +470,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"404": {
|
||||
"description": "Invalid token",
|
||||
"content": {
|
||||
"application/json": {
|
||||
@ -568,12 +568,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
@ -2765,6 +2760,10 @@
|
||||
"$ref": "#/components/schemas/QuestionResource"
|
||||
}
|
||||
},
|
||||
"is_available": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"author_id": {
|
||||
"type": "integer",
|
||||
"example": 2,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user