Skip to content

Commit 2b4bcf3

Browse files
authored
Merge pull request #47 from blackcandy-org/resource-type
Change playable resource type to singular form
2 parents eb4ce4c + b33a1db commit 2b4bcf3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

BlackCandy/Store/PlayerReducer.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ struct PlayerReducer: Reducer {
291291
.playAllResponse(
292292
TaskResult {
293293
switch resourceType {
294-
case "albums":
294+
case "album":
295295
return try await apiClient.replaceCurrentPlaylistWithAlbumSongs(resourceId)
296-
case "playlists":
296+
case "playlist":
297297
return try await apiClient.replaceCurrentPlaylistWithPlaylistSongs(resourceId)
298298
default:
299299
throw APIClient.APIError.invalidRequest

BlackCandyTests/Store/PlayerReducerTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ final class PlayerReducerTests: XCTestCase {
534534

535535
store.exhaustivity = .off
536536

537-
await store.send(.playAll("albums", 1))
537+
await store.send(.playAll("album", 1))
538538

539539
await store.receive(.playAllResponse(.success(songs))) {
540540
$0.playlist.orderedSongs = songs
@@ -555,7 +555,7 @@ final class PlayerReducerTests: XCTestCase {
555555

556556
store.exhaustivity = .off
557557

558-
await store.send(.playAll("playlists", 1))
558+
await store.send(.playAll("playlist", 1))
559559

560560
await store.receive(.playAllResponse(.success(songs))) {
561561
$0.playlist.orderedSongs = songs

0 commit comments

Comments
 (0)