feat: Add bulk delete and merge functionality for inventory items with DTOs and API endpoints
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -59,6 +59,8 @@ class RecipeApiPaths {
|
||||
|
||||
class InventoryApiPaths {
|
||||
static const list = '/inventory';
|
||||
static const mergeMany = '/inventory/merge-many';
|
||||
static const bulkDelete = '/inventory/bulk-delete';
|
||||
static String update(int id) => '/inventory/$id';
|
||||
static String remove(int id) => '/inventory/$id';
|
||||
static String moveToPantry(int id) => '/inventory/$id/move-to-pantry';
|
||||
|
||||
@@ -168,12 +168,19 @@ class AppShell extends ConsumerWidget {
|
||||
PopupMenuButton<String>(
|
||||
tooltip: 'Profil och konto',
|
||||
icon: const Icon(Icons.account_circle_outlined),
|
||||
onSelected: (value) {
|
||||
onSelected: (value) async {
|
||||
switch (value) {
|
||||
case 'profile':
|
||||
if (location != '/profile' && context.mounted) {
|
||||
onNavigateToPath('/profile');
|
||||
}
|
||||
break;
|
||||
case 'logout':
|
||||
await ref.read(authStateProvider.notifier).logout();
|
||||
if (context.mounted) {
|
||||
onNavigateToPath('/login');
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemBuilder: (context) => const [
|
||||
@@ -185,6 +192,15 @@ class AppShell extends ConsumerWidget {
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem<String>(
|
||||
value: 'logout',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.logout),
|
||||
title: Text('Logga ut'),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user