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 0750966 commit 0744854Copy full SHA for 0744854
pc/user.cpp
@@ -365,8 +365,16 @@ void user::parse_get_all_products( uint32_t itok )
365
{
366
add_header();
367
jw_.add_key( "result", json_wtr::e_arr );
368
- for( unsigned i=0; i != sptr_->get_num_product(); ++i ) {
369
- product *prod = sptr_->get_product( i );
+
+ // If the primary manager has no products, pull them from the secondary
370
+ // manager instead.
371
+ pc::manager *mgr = sptr_;
372
+ if ( sptr_->get_num_product() == 0 && sptr_->has_secondary() ) {
373
+ mgr = sptr_->get_secondary();
374
+ }
375
376
+ for( unsigned i=0; i != mgr->get_num_product(); ++i ) {
377
+ product *prod = mgr->get_product( i );
378
jw_.add_val( json_wtr::e_obj );
379
prod->dump_json( jw_ );
380
jw_.pop();
0 commit comments