Skip to content

Commit

Permalink
Added GitHub endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Hashik-Donthineni committed Mar 19, 2019
1 parent 0d1fdd4 commit df8feff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.squareup.leakcanary.LeakCanary;

public class GlobalApplication extends Application {
private static final String BASEURL = "https://pastebin.com";
private static final String BASEURL = "https://raw.githubusercontent.com";
private static JSONData userData;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import retrofit2.http.POST;

public interface LoginService {
@POST("/raw/smkMA2by")
@GET("/Hashik-Donthineni/TemporaryJSONHosting/master/RvrJSON.json")
@Headers("Content-type: application/json")
Call<JSONData> initiateLogin();
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ public void validateCredentials(String username, String pass){
call.enqueue(new Callback<JSONData>() {
@Override
public void onResponse(Call<JSONData> call, Response<JSONData> response) {
Log.d(TAG, "onResponse: Got the response!"+response.body().getUser().getNumber());
GlobalApplication.setUserData(response.body());
validCreds.setValue(true);
processing.setValue(false);
if(response.isSuccessful()){
Log.d(TAG, "onResponse: Got the response!"+response.body().getUser().getNumber());
GlobalApplication.setUserData(response.body());
validCreds.setValue(true);
processing.setValue(false);
}else{
onFailure(call, new Exception());
}
}

@Override
Expand Down

0 comments on commit df8feff

Please sign in to comment.