Skip to content

Commit

Permalink
fix edit
Browse files Browse the repository at this point in the history
  • Loading branch information
FlamesONE committed Aug 24, 2024
1 parent a5f1cdf commit 84ee654
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FAQ",
"version": "1.0.0",
"version": "1.0.1",
"description": "faq.description",
"authors": ["Flames"],
"providers": ["Flute\\Modules\\FAQ\\src\\ServiceProviders\\FAQServiceProvider"],
Expand Down
4 changes: 3 additions & 1 deletion src/Http/Controllers/API/ApiAdminFaqController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public function delete(FluteRequest $request, $id): Response
}
}

public function update(FluteRequest $request, $id): Response
public function update(FluteRequest $request): Response
{
$id = $request->input('id', 0);

try {
$this->faqService->update(
(int) $id,
Expand Down
2 changes: 1 addition & 1 deletion src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
$routeGroup->group(function (RouteGroup $adminRouteGroup) {
$adminRouteGroup->post('add', [ApiAdminFaqController::class, 'store']);
$adminRouteGroup->delete('{id}', [ApiAdminFaqController::class, 'delete']);
$adminRouteGroup->put('{id}', [ApiAdminFaqController::class, 'update']);
$adminRouteGroup->put('edit', [ApiAdminFaqController::class, 'update']);
}, 'api/faq/');
}, 'admin/');

0 comments on commit 84ee654

Please sign in to comment.