refactor: add query params
This commit is contained in:
@@ -6,7 +6,11 @@ import org.joinmastodon.android.api.requests.HeaderPaginationRequest;
|
|||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
|
|
||||||
public class GetAccountBlocks extends HeaderPaginationRequest<Account>{
|
public class GetAccountBlocks extends HeaderPaginationRequest<Account>{
|
||||||
public GetAccountBlocks(){
|
public GetAccountBlocks(String maxID, int limit){
|
||||||
super(HttpMethod.GET, "/blocks", new TypeToken<>(){});
|
super(HttpMethod.GET, "/blocks", new TypeToken<>(){});
|
||||||
|
if(maxID!=null)
|
||||||
|
addQueryParameter("max_id", maxID);
|
||||||
|
if(limit>0)
|
||||||
|
addQueryParameter("limit", limit+"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ import org.joinmastodon.android.api.requests.HeaderPaginationRequest;
|
|||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
|
|
||||||
public class GetAccountMutes extends HeaderPaginationRequest<Account>{
|
public class GetAccountMutes extends HeaderPaginationRequest<Account>{
|
||||||
public GetAccountMutes(){
|
public GetAccountMutes(String maxID, int limit){
|
||||||
super(HttpMethod.GET, "/mutes/", new TypeToken<>(){});
|
super(HttpMethod.GET, "/mutes/", new TypeToken<>(){});
|
||||||
|
if(maxID!=null)
|
||||||
|
addQueryParameter("max_id", maxID);
|
||||||
|
if(limit>0)
|
||||||
|
addQueryParameter("limit", limit+"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class BlocksListFragment extends AccountRelatedAccountListFragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HeaderPaginationRequest<Account> onCreateRequest(String maxID, int count){
|
public HeaderPaginationRequest<Account> onCreateRequest(String maxID, int count){
|
||||||
return new GetAccountBlocks();
|
return new GetAccountBlocks(maxID, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class MutesListFragment extends AccountRelatedAccountListFragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HeaderPaginationRequest<Account> onCreateRequest(String maxID, int count){
|
public HeaderPaginationRequest<Account> onCreateRequest(String maxID, int count){
|
||||||
return new GetAccountMutes();
|
return new GetAccountMutes(maxID, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user