Skip to content

Commit

Permalink
add findbyEmail method
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jul 11, 2024
1 parent 9bf4689 commit 5e0d831
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/Api/V1/Admin/Sales/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function resource(): string
*
* @return \Illuminate\Http\Response
*/
public function search(Request $request)
public function findByEmail(Request $request)
{
$validatedData = $request->validate([
'email' => 'required',
]);
$results = $this->getRepositoryInstance()->search($request->all());
$results = $this->getRepositoryInstance()->findByEmail($request->get('email'));

return $this->resource()::collection($results);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Routes/V1/Admin/sales-routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Route::controller(OrderController::class)->prefix('orders')->group(function () {
Route::get('', 'allResources');

Route::get('search', 'search');
Route::get('find-by-email', 'findByEmail');

Route::get('{id}', 'getResource');

Expand Down

0 comments on commit 5e0d831

Please sign in to comment.