Added API call for generic wiki page.

Updated old wiki-only call to cascade to new generic.
This commit is contained in:
andrewrasch 2021-09-21 23:01:17 -04:00
parent d6c3bfddd7
commit 5cfe8a6016
2 changed files with 7 additions and 2 deletions

View File

@ -71,6 +71,7 @@ import retrofit2.Retrofit;
public class WikiActivity extends BaseActivity {
public static final String EXTRA_SUBREDDIT_NAME = "ESN";
public static final String WIKI_PATH = "WP";
private static final String WIKI_MARKDOWN_STATE = "WMS";
@BindView(R.id.coordinator_layout_comment_wiki_activity)

View File

@ -294,8 +294,12 @@ public interface RedditAPI {
@GET("/api/trending_searches_v1.json?withAds=0&raw_json=1&gilding_detail=1")
Call<String> getTrendingSearches(@HeaderMap Map<String, String> headers);
@GET("/r/{subredditName}/wiki/index.json?raw_json=1")
Call<String> getWiki(@Path("subredditName") String subredditName);
default Call<String> getWiki(@Path("subredditName") String subredditName) {
return getWikiPage(subredditName, "index");
};
@GET("/r/{subredditName}/wiki/{wikiPage}.json?raw_json=1")
Call<String> getWikiPage(@Path("subredditName") String subredditName, @Path("wikiPage") String wikiPage);
@GET("{sortType}?raw_json=1")
ListenableFuture<Response<String>> getBestPostsListenableFuture(@Path("sortType") String sortType, @Query("after") String lastItem, @HeaderMap Map<String, String> headers);