We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a4a2e4 commit 8efd0a9Copy full SHA for 8efd0a9
pc/user.cpp
@@ -361,8 +361,16 @@ void user::parse_get_all_products( uint32_t itok )
361
{
362
add_header();
363
jw_.add_key( "result", json_wtr::e_arr );
364
- for( unsigned i=0; i != sptr_->get_num_product(); ++i ) {
365
- product *prod = sptr_->get_product( i );
+
+ // If the primary manager has no products, pull them from the secondary
366
+ // manager instead.
367
+ pc::manager *mgr = sptr_;
368
+ if ( sptr_->get_num_product() == 0 && sptr_->has_secondary() ) {
369
+ mgr = sptr_->get_secondary();
370
+ }
371
372
+ for( unsigned i=0; i != mgr->get_num_product(); ++i ) {
373
+ product *prod = mgr->get_product( i );
374
jw_.add_val( json_wtr::e_obj );
375
prod->dump_json( jw_ );
376
jw_.pop();
0 commit comments