From 6c2cc204055ce09932f7bba406d90134388e88a7 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Sat, 17 Aug 2019 20:54:52 +0200 Subject: [PATCH] YoLo Added a banner to the default admin page. Please have mercy on me =( --- app/Http/Controllers/API/AppController.php | 3 + app/Http/Resources/API/Mail.php | 4 +- public/docs/api.yml | 65 ++++++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/API/AppController.php b/app/Http/Controllers/API/AppController.php index b1c6f42..ce9c749 100644 --- a/app/Http/Controllers/API/AppController.php +++ b/app/Http/Controllers/API/AppController.php @@ -159,4 +159,7 @@ class AppController extends BaseController return $response->withData(AppUser::collection($access)); } + + + } diff --git a/app/Http/Resources/API/Mail.php b/app/Http/Resources/API/Mail.php index 2b84966..646dbf9 100644 --- a/app/Http/Resources/API/Mail.php +++ b/app/Http/Resources/API/Mail.php @@ -19,8 +19,8 @@ class Mail extends JsonResource 'created_at' => $this->created_at, 'updated_at' => $this->created_at, 'status' => $this->status, - 'primary' => $this->primary, + 'primary' => (boolean)$this->primary, 'mail' => $this->mail ]; } -} \ No newline at end of file +} diff --git a/public/docs/api.yml b/public/docs/api.yml index e15ee3d..526a76b 100644 --- a/public/docs/api.yml +++ b/public/docs/api.yml @@ -308,6 +308,41 @@ paths: msg: type: "string" example: "You need to login" + /user/me/mail: + get: + tags: + - "user" + summary: "Return Mail adddresses for te User" + description: "" + produces: + - "application/json" + responses: + 200: + description: "Found user and return informations" + schema: + type: "object" + properties: + data: + type: array + items: + $ref: '#/definitions/Mail' + success: + type: "boolean" + example: true + msg: + type: "string" + example: "" + 401: + description: "Not logged in" + schema: + type: "object" + properties: + success: + type: "boolean" + example: false + msg: + type: "string" + example: "You need to login" /account: get: tags: @@ -843,6 +878,36 @@ definitions: type: "boolean" example: false description: "If the user is a admin Account" + Mail: + type: "object" + properties: + id: + type: "integer" + format: "int64" + example: 18 + created_at: + type: "string" + format: "DateTime" + example: "2019-07-17T13:37:40.000000Z" + updated_at: + type: "string" + format: "DateTime" + example: "2019-07-17T13:37:40.000000Z" + status: + type: "string" + enum: + - "valide" + - "waiting" + - "invalide" + primary: + type: boolean + description: "If this mail is the user primary mail" + example: true + mail: + type: string + format: mail + example: "mail@example.com" + AppForOwner: type: "object" properties: