diff --git a/lib/src/integrationTest/java/io/github/taz03/jia/accounts/EditProfileTest.java b/lib/src/integrationTest/java/io/github/taz03/jia/accounts/EditProfileTest.java index e767a0b..82f8347 100644 --- a/lib/src/integrationTest/java/io/github/taz03/jia/accounts/EditProfileTest.java +++ b/lib/src/integrationTest/java/io/github/taz03/jia/accounts/EditProfileTest.java @@ -26,7 +26,7 @@ public final class EditProfileTest { @Test public void editProfileTest() throws Exception { - EditProfileRequest request = new EditProfileRequest("JIA", "JIA test bio [edit profile request]", user.username(), user.phoneNumber(), user.email(), ""); + EditProfileRequest request = new EditProfileRequest(user.username(), "JIA", "JIA test bio [edit profile request]", "", false, user.phoneNumber(), user.email()); UserResponse response = client.sendRequest(request).get(); assertEquals("ok", response.getStatus()); diff --git a/lib/src/main/java/io/github/taz03/jia/requests/accounts/EditProfileRequest.java b/lib/src/main/java/io/github/taz03/jia/requests/accounts/EditProfileRequest.java index 5c4ee7c..f199546 100644 --- a/lib/src/main/java/io/github/taz03/jia/requests/accounts/EditProfileRequest.java +++ b/lib/src/main/java/io/github/taz03/jia/requests/accounts/EditProfileRequest.java @@ -11,22 +11,26 @@ public final class EditProfileRequest extends InstagramPostRequest { /** * Creates an Instagram edit profile request. + *

+ * At least one connected contact is necessary to edit profile data. * - * @param name New display name to set - * @param biography New biography to set - * @param username New username to set - * @param phoneNumber Current phone number - * @param email Current email - * @param externalUrl New external url to set + * @param username New username to set + * @param name New display name to set + * @param biography New biography to set + * @param externalUrl New external url to set + * @param showFbLinkOnProfile To show the connected Facebook account on the profile + * @param phoneNumber Current phone number + * @param email Current email */ - public EditProfileRequest(String name, String biography, String username, String phoneNumber, String email, String externalUrl) { + public EditProfileRequest(String username, String name, String biography, String externalUrl, boolean showFbLinkOnProfile, String phoneNumber, String email) { super(UserResponse.class, "/api/v1/accounts/edit_profile/", null, Map.of( + "username", username, "first_name", name, "biography", biography, - "username", username, + "external_url", externalUrl, + "show_fb_link_on_profile", showFbLinkOnProfile, "phone_number", phoneNumber, - "email", email, - "external_url", externalUrl + "email", email )); } }