Browse Source

Fix Request API schema to match the webserver RESTful schema

dev
David Ludwig 4 years ago
parent
commit
b4ed9cb4d1
3 changed files with 6 additions and 4 deletions
  1. +1
    -1
      api/request/src/schema.ts
  2. +1
    -1
      services/request/src/services/MovieSearch.ts
  3. +4
    -2
      services/request/src/services/WebServer/routes/auth.ts

+ 1
- 1
api/request/src/schema.ts View File

@ -32,7 +32,7 @@ export interface IApiResponse {
* A generic data response from the API
*/
export interface IApiDataResponse<T> extends IApiResponse {
data: T
result: T
}
/**


+ 1
- 1
services/request/src/services/MovieSearch.ts View File

@ -72,7 +72,7 @@ export default class MovieSearch extends InternalService<Application>
MovieTicket.activeTicketMap()
]);
let plexLinks = await this.plex.movieLinks(movies.results.map(movie => movie.tmdbId));
return <IPaginatedResponse<IMovie>["data"]>{
return <IPaginatedResponse<IMovie>["result"]>{
page: movies.page,
results: movies.results.map(movie => <IMovie>{
...movie,


+ 4
- 2
services/request/src/services/WebServer/routes/auth.ts View File

@ -12,9 +12,11 @@ import { auth } from "../middleware/auth";
*/
export default function register(factory: RouteRegisterFactory<MiddlewareMethod<void>, Application>, app: Application) {
/**
* Verify the auth token
*/
factory.get("/auth/verify", [auth], (request, reply) => {
console.log("Authentication has been verified");
reply.send({ status: "Success" });
respond(reply, Status.Ok);
});
// Login ---------------------------------------------------------------------------------------


Loading…
Cancel
Save