reorder method
Reorder - create new cart from existing order
Implementation
Future<Cart> reorder(String orderId) async {
try {
final response = await _client.authenticatedRequest<Map<String, dynamic>>(
'/rest/V1/orders/$orderId/reorder',
options: Options(method: 'POST'),
);
if (response.statusCode == 200) {
// TODO: Return Cart model instead of Map
// For now, create a basic cart response
return Cart.fromJson(response.data!);
} else {
throw Exception('Failed to reorder: ${response.statusMessage}');
}
} on DioException catch (e) {
throw Exception('Failed to reorder: ${e.message}');
} catch (e) {
throw Exception('Failed to reorder: $e');
}
}