|
|
@ -1,7 +1,7 @@ |
|
|
|
import { IpcClientService } from "@autoplex/ipc"; |
|
|
|
import { Microservice } from "@autoplex/microservice"; |
|
|
|
import { SOCKET_PATH } from "./constants"; |
|
|
|
import { IMovie, IMovieDetails } from "./schema"; |
|
|
|
import { IMovie, IMovieDetails, IPaginatedResponse } from "./schema"; |
|
|
|
|
|
|
|
export class IpcClient<M extends Microservice = Microservice> extends IpcClientService<M> |
|
|
|
{ |
|
|
@ -36,7 +36,7 @@ export class IpcClient<M extends Microservice = Microservice> extends IpcClientS |
|
|
|
console.error("Failed to find a movie by its IMDb ID:", result.error); |
|
|
|
throw new Error("Failed to find a movie by its IMDb ID"); |
|
|
|
} |
|
|
|
return <IMovie>result.data; |
|
|
|
return <IMovie|null>result.data; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -48,7 +48,7 @@ export class IpcClient<M extends Microservice = Microservice> extends IpcClientS |
|
|
|
console.error("Failed to search for a movie:", result.error); |
|
|
|
throw new Error("Failed to search for a movie"); |
|
|
|
} |
|
|
|
return <IMovie>result.data; |
|
|
|
return <IPaginatedResponse<IMovie>>result.data; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|