Questions

This commit is contained in:
Stepan 2025-11-11 19:52:43 +01:00
parent 7dd13799e5
commit 590a346781
2 changed files with 13 additions and 13 deletions

View File

@ -137,8 +137,8 @@ class QuestionController extends Controller
/** /**
* @OA\Post( * @OA\Post(
* path="/api/questions", * path="/api/questions",
* summary="Create a new question", * summary="Create a new question (only admin or creator)",
* description="Store a new question in the system (only admin or creator).", * description="Store a new question in the system.",
* tags={"Questions"}, * tags={"Questions"},
* security={{"bearerAuth":{}}}, * security={{"bearerAuth":{}}},
* @OA\RequestBody( * @OA\RequestBody(
@ -201,8 +201,8 @@ class QuestionController extends Controller
/** /**
* @OA\Put( * @OA\Put(
* path="/api/questions/{id}", * path="/api/questions/{id}",
* summary="Update a question", * summary="Update a question (only admin or creator)",
* description="Update an existing question by ID (only admin or creator).", * description="Update an existing question by ID.",
* tags={"Questions"}, * tags={"Questions"},
* security={{"bearerAuth":{}}}, * security={{"bearerAuth":{}}},
* @OA\Parameter( * @OA\Parameter(
@ -272,8 +272,8 @@ class QuestionController extends Controller
/** /**
* @OA\Delete( * @OA\Delete(
* path="/api/questions/{id}", * path="/api/questions/{id}",
* summary="Delete a question", * summary="Delete a question (only admin or creator)",
* description="Delete a question by ID (only admin or creator).", * description="Delete a question by ID .",
* tags={"Questions"}, * tags={"Questions"},
* security={{"bearerAuth":{}}}, * security={{"bearerAuth":{}}},
* @OA\Parameter( * @OA\Parameter(
@ -308,7 +308,7 @@ class QuestionController extends Controller
{ {
$this->authorize('delete', $question); $this->authorize('delete', $question);
$question->delete(); $question->delete();
Log::writeLog("Question '" . $question->id . "' is deleted by " . $request->user()->username); Log::writeLog("Question '" . $question->title . "' is deleted by " . $request->user()->username);
return ['message' => 'The hitcount was deleted']; return ['message' => 'The hitcount was deleted'];
} }

View File

@ -1188,8 +1188,8 @@
"tags": [ "tags": [
"Questions" "Questions"
], ],
"summary": "Create a new question", "summary": "Create a new question (only admin or creator)",
"description": "Store a new question in the system (only admin or creator).", "description": "Store a new question in the system.",
"operationId": "788d85763184ddf1b557afb040547f32", "operationId": "788d85763184ddf1b557afb040547f32",
"requestBody": { "requestBody": {
"required": true, "required": true,
@ -1332,8 +1332,8 @@
"tags": [ "tags": [
"Questions" "Questions"
], ],
"summary": "Update a question", "summary": "Update a question (only admin or creator)",
"description": "Update an existing question by ID (only admin or creator).", "description": "Update an existing question by ID.",
"operationId": "795b02e5ecdc23fd74f20e0671a40f8c", "operationId": "795b02e5ecdc23fd74f20e0671a40f8c",
"parameters": [ "parameters": [
{ {
@ -1448,8 +1448,8 @@
"tags": [ "tags": [
"Questions" "Questions"
], ],
"summary": "Delete a question", "summary": "Delete a question (only admin or creator)",
"description": "Delete a question by ID (only admin or creator).", "description": "Delete a question by ID .",
"operationId": "b2cbd34337a604c75c8a94f1a6e2f252", "operationId": "b2cbd34337a604c75c8a94f1a6e2f252",
"parameters": [ "parameters": [
{ {