Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 7c3623f

Browse files
Merge pull request #488 from wordpress-mobile/issue/change-cards-endpoint
Change cards endpoint URL
2 parents 4813114 + 455bb29 commit 7c3623f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressKit'
5-
s.version = '4.47.0'
5+
s.version = '4.48.0-beta.1'
66

77
s.summary = 'WordPressKit offers a clean and simple WordPress.com and WordPress.org API.'
88
s.description = <<-DESC

WordPressKit/DashboardServiceRemote.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ open class DashboardServiceRemote: ServiceRemoteWordPressComREST {
2222
}
2323

2424
private func endpoint(for cards: [String], blogID: Int) -> String? {
25-
var path = URLComponents(string: "sites/\(blogID)/dashboard/cards/v1_1/")
25+
var path = URLComponents(string: "sites/\(blogID)/dashboard/cards-data/")
2626

2727
let cardsEncoded = cards.joined(separator: ",")
2828
path?.queryItems = [URLQueryItem(name: "cards", value: cardsEncoded)]

WordPressKitTests/DashboardServiceRemoteTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable {
1414
//
1515
func testRequestCardsParam() {
1616
let expect = expectation(description: "Get cards successfully")
17-
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards/v1_1/?cards=posts,todays_stats", filename: "dashboard-200-with-drafts-and-scheduled-posts.json", contentType: .ApplicationJSON)
17+
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards-data/?cards=posts,todays_stats", filename: "dashboard-200-with-drafts-and-scheduled-posts.json", contentType: .ApplicationJSON)
1818

1919
dashboardServiceRemote.fetch(cards: ["posts", "todays_stats"], forBlogID: 165243437) { _ in
2020
expect.fulfill()
@@ -27,7 +27,7 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable {
2727
//
2828
func testRequestCards() {
2929
let expect = expectation(description: "Get cards successfully")
30-
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards/v1_1/?cards=posts,todays_stats", filename: "dashboard-200-with-drafts-and-scheduled-posts.json", contentType: .ApplicationJSON)
30+
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards-data/?cards=posts,todays_stats", filename: "dashboard-200-with-drafts-and-scheduled-posts.json", contentType: .ApplicationJSON)
3131

3232
dashboardServiceRemote.fetch(cards: ["posts", "todays_stats"], forBlogID: 165243437) { cards in
3333
XCTAssertTrue((cards["posts"] as! NSDictionary)["has_published"] as! Bool)
@@ -42,7 +42,7 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable {
4242
//
4343
func testRequestFails() {
4444
let expect = expectation(description: "Get cards successfully")
45-
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards/v1_1/?cards=posts,todays_stats", filename: "dashboard-200-with-drafts-and-scheduled-posts.json", contentType: .ApplicationJSON, status: 503)
45+
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards-data/?cards=posts,todays_stats", filename: "dashboard-200-with-drafts-and-scheduled-posts.json", contentType: .ApplicationJSON, status: 503)
4646

4747
dashboardServiceRemote.fetch(cards: ["posts", "todays_stats"], forBlogID: 165243437) { _ in
4848
XCTFail("This call should not suceed")
@@ -57,7 +57,7 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable {
5757
//
5858
func testRequestInvalidCard() {
5959
let expect = expectation(description: "Get cards successfully")
60-
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards/v1_1/?cards=invalid_card", filename: "dashboard-400-invalid-card.json", contentType: .ApplicationJSON, status: 400)
60+
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards-data/?cards=invalid_card", filename: "dashboard-400-invalid-card.json", contentType: .ApplicationJSON, status: 400)
6161

6262
dashboardServiceRemote.fetch(cards: ["invalid_card"], forBlogID: 165243437) { _ in
6363
XCTFail("This call should not suceed")
@@ -72,7 +72,7 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable {
7272
//
7373
func testRequestInvalidJSON() {
7474
let expect = expectation(description: "Get cards successfully")
75-
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards/v1_1/?cards=posts,todays_stats", data: "foo".data(using: .utf8)!, contentType: .ApplicationJSON)
75+
stubRemoteResponse("wpcom/v2/sites/165243437/dashboard/cards-data/?cards=posts,todays_stats", data: "foo".data(using: .utf8)!, contentType: .ApplicationJSON)
7676

7777
dashboardServiceRemote.fetch(cards: ["posts", "todays_stats"], forBlogID: 165243437) { _ in
7878
XCTFail("This call should not suceed")

0 commit comments

Comments
 (0)