Skip to content

Commit 25c3d7b

Browse files
committed
Fix followers
1 parent 0d8115e commit 25c3d7b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

components/wordpress_com/sources/new-follower/new-follower.mjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default {
1414
return this.wordpress.getWordpressFollowers({
1515
$,
1616
site: this.site,
17+
type: this.type,
1718
});
1819

1920
},
@@ -27,6 +28,22 @@ export default {
2728
"siteId",
2829
],
2930
},
31+
type: {
32+
type: "string",
33+
label: "Follower Type",
34+
description: "Select the type of followers to fetch: those who clicked Subscribe or those manually added in the dashboard.",
35+
options: [
36+
{
37+
label: "WordPress.com Followers",
38+
value: "wpcom",
39+
},
40+
{
41+
label: "Email-only Followers",
42+
value: "email",
43+
},
44+
],
45+
default: "wpcom",
46+
},
3047
timer: {
3148
type: "$.interface.timer",
3249
label: "Timer",

components/wordpress_com/wordpress_com.app.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ export default {
139139
},
140140
getWordpressFollowers({
141141
site,
142+
type,
142143
...opts
143144
}) {
144145
return this._makeRequest({
145146
method: "GET",
146-
path: `/sites/${site}/followers/`,
147+
path: `/sites/${site}/stats/followers?type=${type}`,
147148
...opts,
148149
});
149150
},

0 commit comments

Comments
 (0)