diff --git a/services/comicvine.service.ts b/services/comicvine.service.ts index 8b6eef1..19cf712 100644 --- a/services/comicvine.service.ts +++ b/services/comicvine.service.ts @@ -14,7 +14,7 @@ export default class GreeterService extends Service { name: "comicvine", actions: { fetchSeries: { - rest: "/fetchseries", + rest: "/fetchresource", params: { format: { type: "string", optional: false }, sort: { type: "string", optional: true }, @@ -63,6 +63,31 @@ export default class GreeterService extends Service { return data; }, }, + search: { + rest: "/search", + params: {}, + handler: async (ctx: Context<{ + format: string; + sort: string; + query: string; + fieldList: string; + limit: string; + offset: string; + resources: string; + }>) => { + const response = await axios.request({ + url: + CV_BASE_URL + + "search" + + "?api_key=" + + CV_API_KEY, + params: ctx.params, + headers: { Accept: "application/json" }, + }); + const { data } = response; + return data; + }, + }, }, }); }