fix: promotion
This commit is contained in:
@@ -27,6 +27,19 @@ public function index()
|
||||
return response()->json($promotions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin listing: returns ALL promotions regardless of is_active or the
|
||||
* start/end window, so admins can see and edit inactive/expired ones.
|
||||
*/
|
||||
public function adminIndex()
|
||||
{
|
||||
$promotions = Promotion::orderBy('priority', 'desc')
|
||||
->orderByDesc('id')
|
||||
->get();
|
||||
|
||||
return response()->json($promotions);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->validate([
|
||||
|
||||
@@ -90,6 +90,8 @@
|
||||
Route::get('/users', 'users');
|
||||
// All subscription purchases (transactions) with filters
|
||||
Route::get('/purchases', 'purchases');
|
||||
// All promotions (including inactive/expired) for admin management
|
||||
Route::get('/promotions', [PromotionController::class, 'adminIndex']);
|
||||
Route::post('/users/{mobile}/profile', 'updateUserProfile');
|
||||
Route::delete('/users/{mobile}', 'deleteUser');
|
||||
Route::get('/users/{mobile}/transactions', 'getUserTransactions');
|
||||
|
||||
Reference in New Issue
Block a user