Skip to content

Commit

Permalink
Fix logic of theme installation on atomic sites
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamboushaba committed Nov 24, 2023
1 parent f44bf85 commit 89d2c38
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ public void deleteTheme(@NonNull final SiteModel site, @NonNull final ThemeModel
* [Undocumented!] Endpoint: v1.1/sites/$siteId/themes/$themeId/install
*/
public void installTheme(@NonNull final SiteModel site, @NonNull final ThemeModel theme) {
String themeId = getThemeIdWithWpComSuffix(theme);
String themeId = theme.getThemeId();
if (!site.isWPComAtomic()) {
themeId = getThemeIdWithWpComSuffix(theme);
}
String url = WPCOMREST.sites.site(site.getSiteId()).themes.theme(themeId).install.getUrlV1_1();
add(WPComGsonRequest.buildPostRequest(url, null, JetpackThemeResponse.class,
response -> {
Expand Down

0 comments on commit 89d2c38

Please sign in to comment.