Skip to content

Commit

Permalink
Merge branch 'kudoleh:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tsanto committed Mar 7, 2023
2 parents 3e74678 + 4f8436e commit 5b48533
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct APIEndpoints {

static func getMovies(with moviesRequestDTO: MoviesRequestDTO) -> Endpoint<MoviesResponseDTO> {

return Endpoint(path: "3/search/movie/",
return Endpoint(path: "3/search/movie",
method: .get,
queryParametersEncodable: moviesRequestDTO)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class CoreDataMoviesResponseStorage {

extension CoreDataMoviesResponseStorage: MoviesResponseStorage {

func getResponse(for requestDto: MoviesRequestDTO, completion: @escaping (Result<MoviesResponseDTO?, CoreDataStorageError>) -> Void) {
func getResponse(for requestDto: MoviesRequestDTO, completion: @escaping (Result<MoviesResponseDTO?, Error>) -> Void) {
coreDataStorage.performBackgroundTask { context in
do {
let request = self.fetchRequest(for: requestDto)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
import Foundation

protocol MoviesResponseStorage {
func getResponse(for request: MoviesRequestDTO, completion: @escaping (Result<MoviesResponseDTO?, CoreDataStorageError>) -> Void)
func getResponse(for request: MoviesRequestDTO, completion: @escaping (Result<MoviesResponseDTO?, Error>) -> Void)
func save(response: MoviesResponseDTO, for requestDto: MoviesRequestDTO)
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension DefaultMoviesRepository: MoviesRepository {
cache.getResponse(for: requestDTO) { result in

if case let .success(responseDTO?) = result {
cached(responseDTO.toDomain())
DispatchQueue.main.async { cached(responseDTO.toDomain()) }
}
guard !task.isCancelled else { return }

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ GEM
tty-screen (0.7.0)
tty-spinner (0.9.2)
tty-cursor (~> 0.7)
tzinfo (1.2.6)
tzinfo (1.2.10)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
Expand Down

0 comments on commit 5b48533

Please sign in to comment.