Check Issue Subscription and display button based on that (#445)
update string names Update strings Merge branch 'master' into imprufe-issue-subscription-checking switch icon as per @mmarif Migrate to new Version Check & disable IssueSubscription function for gitea < 1.12.0 Merge branch 'master' into imprufe-issue-subscription-checking Merge branch 'master' into imprufe-issue-subscription-checking Merge branch 'master' into imprufe-issue-subscription-checking refactor & use dismiss() realy check If issue is subscribed add 200 http Status check and handle it Rename WatchRepository to WatchInfo & add checkIssueWatchStatus Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/445 Reviewed-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
@@ -31,7 +31,7 @@ import org.mian.gitnex.models.UserOrganizations;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.models.UserSearch;
|
||||
import org.mian.gitnex.models.UserTokens;
|
||||
import org.mian.gitnex.models.WatchRepository;
|
||||
import org.mian.gitnex.models.WatchInfo;
|
||||
import java.util.List;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
@@ -247,7 +247,7 @@ public interface ApiInterface {
|
||||
Call<JsonElement> unStarRepository(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
|
||||
@GET("repos/{owner}/{repo}/subscription") // check watch status of a repository
|
||||
Call<WatchRepository> checkRepoWatchStatus(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
Call<WatchInfo> checkRepoWatchStatus(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
|
||||
@PUT("repos/{owner}/{repo}/subscription") // watch a repository
|
||||
Call<JsonElement> watchRepository(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
@@ -255,6 +255,9 @@ public interface ApiInterface {
|
||||
@DELETE("repos/{owner}/{repo}/subscription") // un watch a repository
|
||||
Call<JsonElement> unWatchRepository(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName);
|
||||
|
||||
@GET("repos/{owner}/{repo}/issues/{index}/subscriptions/check")
|
||||
Call<WatchInfo> checkIssueWatchStatus(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int issueIndex);
|
||||
|
||||
@PUT("repos/{owner}/{repo}/issues/{index}/subscriptions/{user}") // subscribe user to issue
|
||||
Call<Void> addIssueSubscriber(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int issueIndex, @Path("user") String issueSubscriber);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user