Skip to content

Commit

Permalink
Merge branch 'update-seeder' of https://github.com/uasoft-indonesia/b…
Browse files Browse the repository at this point in the history
…adaso-content-module into update-seeder
  • Loading branch information
miftahurrahmi committed Feb 19, 2024
2 parents 509039a + b8745ef commit 5f00e67
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 206 deletions.
14 changes: 7 additions & 7 deletions src/Controllers/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function read(Request $request)
$content = Content::where('id', $request->id)->first();

$data = [
'id' => $content->id,
'slug' => $content->slug,
'id' => $content->id,
'slug' => $content->slug,
'label' => $content->label,
'value' => json_decode($content->value),
];
Expand Down Expand Up @@ -92,7 +92,7 @@ public function add(Request $request)

try {
$request->validate([
'slug' => 'required|string|unique:Uasoft\Badaso\Module\Content\Models\Content',
'slug' => 'required|string|unique:Uasoft\Badaso\Module\Content\Models\Content',
'label' => 'required|string',
'value' => 'required',
]);
Expand All @@ -119,8 +119,8 @@ public function edit(Request $request)

try {
$request->validate([
'id' => 'required|exists:Uasoft\Badaso\Module\Content\Models\Content',
'slug' => 'required|string|exists:Uasoft\Badaso\Module\Content\Models\Content',
'id' => 'required|exists:Uasoft\Badaso\Module\Content\Models\Content',
'slug' => 'required|string|exists:Uasoft\Badaso\Module\Content\Models\Content',
'label' => 'required|string',
'value' => 'required',
]);
Expand All @@ -147,8 +147,8 @@ public function fill(Request $request)

try {
$request->validate([
'id' => 'required|exists:Uasoft\Badaso\Module\Content\Models\Content,id',
'slug' => 'required|string|exists:Uasoft\Badaso\Module\Content\Models\Content,slug',
'id' => 'required|exists:Uasoft\Badaso\Module\Content\Models\Content,id',
'slug' => 'required|string|exists:Uasoft\Badaso\Module\Content\Models\Content,slug',
'label' => 'required|string',
'value' => 'required',
]);
Expand Down
94 changes: 52 additions & 42 deletions src/Swagger/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* tags={"content"},
* summary="Browse Content",
* description="Browse Content",
*
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
Expand All @@ -24,14 +25,17 @@
* tags={"content"},
* summary="Read Content",
* description="Read Content",
*
* @OA\Parameter(
* name="id",
* required=true,
* in="query",
*
* @OA\Schema(
* type="string"
* )
* ),
*
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
Expand All @@ -42,46 +46,52 @@
* )
*/

/**
* @OA\Get(
* path="/module/content/v1/content/fetch",
* operationId="browseModuleContentV1ContentFetch",
* tags={"content"},
* summary="Fetch Content",
* description="Fetch Content",
* @OA\Parameter(
* name="slug",
* required=true,
* in="query",
* @OA\Schema(
* type="string"
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/
/**
* @OA\Get(
* path="/module/content/v1/content/fetch",
* operationId="browseModuleContentV1ContentFetch",
* tags={"content"},
* summary="Fetch Content",
* description="Fetch Content",
*
* @OA\Parameter(
* name="slug",
* required=true,
* in="query",
*
* @OA\Schema(
* type="string"
* )
* ),
*
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/

/**
* @OA\Get(
* path="/module/content/v1/content/fetch-multiple",
* operationId="browseModuleContentV1ContentFetchMultiple",
* tags={"content"},
* summary="Fetch Multiple Content",
* description="Fetch Multiple Content",
* @OA\Parameter(
* name="slug",
* required=true,
* in="query",
* @OA\Schema(
* type="string"
* )
* ),
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/
/**
* @OA\Get(
* path="/module/content/v1/content/fetch-multiple",
* operationId="browseModuleContentV1ContentFetchMultiple",
* tags={"content"},
* summary="Fetch Multiple Content",
* description="Fetch Multiple Content",
*
* @OA\Parameter(
* name="slug",
* required=true,
* in="query",
*
* @OA\Schema(
* type="string"
* )
* ),
*
* @OA\Response(response=200, description="Successful operation"),
* @OA\Response(response=400, description="Bad request"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=402, description="Payment Required"),
* )
*/
Loading

0 comments on commit 5f00e67

Please sign in to comment.