Skip to content

Commit

Permalink
Merge branch 'feature/remove-headers-redeem' of https://github.com/op…
Browse files Browse the repository at this point in the history
…enfoodfoundation/vine into feature/remove-headers-redeem
  • Loading branch information
ok200paul committed Oct 10, 2024
2 parents f647490 + 463ec9a commit a5cdc35
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ public function index(): JsonResponse

/**
* POST /
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function store(): JsonResponse
Expand Down Expand Up @@ -193,7 +195,9 @@ public function show(int $id)
* PUT /{id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function update(string $id)
Expand All @@ -208,7 +212,9 @@ public function update(string $id)
* DELETE / {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function destroy(string $id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ApiAdminFileUploadsController extends Controller

/**
* GET /
*
* @hideFromAPIDocumentation
*/
public function index(): JsonResponse
Expand Down Expand Up @@ -185,8 +186,11 @@ public function store(): JsonResponse

/**
* GET /{id}
*
* @hideFromAPIDocumentation
*
* @param int $id
*
* @return JsonResponse
*/
public function show(int $id): JsonResponse
Expand All @@ -199,8 +203,11 @@ public function show(int $id): JsonResponse

/**
* PUT /{id}
*
* @hideFromAPIDocumentation
*
* @param int $id
*
* @return JsonResponse
*/
public function update(int $id): JsonResponse
Expand All @@ -213,8 +220,11 @@ public function update(int $id): JsonResponse

/**
* DELETE /{id}
*
* @hideFromAPIDocumentation
*
* @param int $id
*
* @return JsonResponse
*/
public function destroy(int $id): JsonResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public function index(): JsonResponse

/**
* POST /
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function store(): JsonResponse
Expand All @@ -89,7 +91,9 @@ public function store(): JsonResponse
* GET /{id}
*
* @param int $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function show(int $id)
Expand All @@ -104,7 +108,9 @@ public function show(int $id)
* PUT /{id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function update(string $id)
Expand All @@ -119,7 +125,9 @@ public function update(string $id)
* DELETE / {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function destroy(string $id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Knuckles\Scribe\Attributes\QueryParam;
use Knuckles\Scribe\Attributes\Response;
use Knuckles\Scribe\Attributes\Subgroup;
use Knuckles\Scribe\Attributes\UrlParam;

#[Group('Admin Endpoints')]
#[Subgroup('/admin/system-statistics', 'Search for system objects as an admin.')]
Expand Down Expand Up @@ -117,7 +116,9 @@ public function index(): JsonResponse

/**
* POST /
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function store(): JsonResponse
Expand Down Expand Up @@ -186,7 +187,9 @@ public function show(int $id)
* PUT /{id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function update(string $id)
Expand All @@ -201,7 +204,9 @@ public function update(string $id)
* DELETE / {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function destroy(string $id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ public function store(): JsonResponse
* GET /{id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function show(string $id)
Expand All @@ -252,7 +254,9 @@ public function show(string $id)
* PUT /{id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function update(string $id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ public function store(): JsonResponse
* GET / {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function show(string $id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ public function store(): JsonResponse

/**
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
* GET / {id}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ public function index(): JsonResponse
description: 'The path to the font being used in the template',
required : true
)]

public function store(): JsonResponse
{
$validationArray = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Knuckles\Scribe\Attributes\QueryParam;
use Knuckles\Scribe\Attributes\Response;
use Knuckles\Scribe\Attributes\Subgroup;
use Knuckles\Scribe\Attributes\UrlParam;

#[Group('Admin Endpoints')]
#[Subgroup('/admin/teams', 'API for managing teams')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ public function store(): JsonResponse
* The validation array.
*/
$validationArray = [
'user_id' => [
'user_id' => [
'required',
Rule::exists('users', 'id'),
],
'name' => [
'name' => [
'required',
'string',
],
'token_abilities' => [
'token_abilities' => [
'required',
'array',
],
Expand All @@ -179,7 +179,7 @@ public function store(): JsonResponse
],
];

$messages = [
$messages = [
'token_abilities' => 'Please ensure the token has at least 1 ability associated to it.',
];
$validator = Validator::make($this->request->all(), $validationArray, $messages);
Expand All @@ -188,9 +188,10 @@ public function store(): JsonResponse

$this->responseCode = 400;
$this->message = $validator->errors()
->first();
->first();

} else {
}
else {

try {

Expand All @@ -210,7 +211,8 @@ public function store(): JsonResponse

event(new PersonalAccessTokenWasCreated($token->accessToken));

} catch (Exception $e) {
}
catch (Exception $e) {

$this->responseCode = 500;
$this->message = ApiResponse::RESPONSE_ERROR->value . ': "' . $e->getMessage() . '".';
Expand Down Expand Up @@ -280,7 +282,9 @@ public function show(string $id)
* PUT/ {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function update(string $id)
Expand Down Expand Up @@ -314,14 +318,16 @@ public function destroy(string $id)
$this->responseCode = 404;
$this->message = ApiResponse::RESPONSE_NOT_FOUND->value;

} else {
}
else {

$model->delete();
$this->message = ApiResponse::RESPONSE_DELETED->value;

}

} catch (Exception $e) {
}
catch (Exception $e) {

$this->responseCode = 500;
$this->message = ApiResponse::RESPONSE_ERROR->value . ':' . $e->getMessage();
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Api/V1/Admin/ApiAdminUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ public function update(string $id)
* DELETE / {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function destroy(string $id)
Expand Down
9 changes: 8 additions & 1 deletion app/Http/Controllers/Api/V1/ApiMyTeamSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ public function index(): JsonResponse
return $this->respond();
}


/**
* POST /
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function store(): JsonResponse
Expand All @@ -104,7 +105,9 @@ public function store(): JsonResponse
* GET /{id}
*
* @param int $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function show(int $id)
Expand All @@ -119,7 +122,9 @@ public function show(int $id)
* PUT /{id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function update(string $id)
Expand All @@ -134,7 +139,9 @@ public function update(string $id)
* DELETE / {id}
*
* @param string $id
*
* @hideFromAPIDocumentation
*
* @return JsonResponse
*/
public function destroy(string $id)
Expand Down
2 changes: 1 addition & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use App\Enums\PersonalAccessTokenAbility;
use App\Http\Controllers\Api\V1\Admin\ApiAdminAuditItemsController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminFileUploadsController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminSearchController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminSystemStatisticsController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminTeamMerchantTeamsController;
Expand All @@ -14,7 +15,6 @@
use App\Http\Controllers\Api\V1\Admin\ApiAdminVoucherRedemptionsController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminVouchersController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminVoucherSetsController;
use App\Http\Controllers\Api\V1\Admin\ApiAdminFileUploadsController;
use App\Http\Controllers\Api\V1\ApiCountriesController;
use App\Http\Controllers\Api\V1\ApiMyTeamAuditItemsController;
use App\Http\Controllers\Api\V1\ApiMyTeamController;
Expand Down

0 comments on commit a5cdc35

Please sign in to comment.