| @@ -71,8 +71,13 @@ | ||
| 71 | 71 | if( !Data::isNullOrEmptyStr( $request->body('taxonomies') ) ){ |
| 72 | 72 | $args['taxonomies'] = Sanitize::textfield( $request->body('taxonomies') ); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | + // check if request is for handpicked data or not | |
| 76 | + if ( !Data::isNullOrEmptyStr( $request->body('handpicked') ) ) { | |
| 77 | + $args['orderBy'] = 'post__in'; | |
| 78 | + } | |
| 79 | + | |
| 75 | 80 | $posts = \Depicter::dataSource()->posts()->previewRecords( $args ); |
| 76 | 81 | |
| 77 | 82 | return \Depicter::json([ |
| 78 | 83 | 'hits' => $posts |
| @@ -107,9 +112,9 @@ | ||
| 107 | 112 | $args['excludedIds'] = JSON::decode( $request->body('excludedIds') ); |
| 108 | 113 | } |
| 109 | 114 | |
| 110 | 115 | $posts = \Depicter::dataSource()->posts()->searchRecordsByTitle( $args ); |
| 111 | - | |
| 116 | + | |
| 112 | 117 | return \Depicter::json([ |
| 113 | 118 | 'hits' => $posts |
| 114 | 119 | ])->withStatus(200); |
| 115 | 120 | } |