2022-09-26 12:04:37 +03:00
|
|
|
import genericProxyHandler from "utils/proxy/handlers/generic";
|
|
|
|
import { asJson } from "utils/proxy/api-helpers";
|
2022-09-25 14:31:41 -07:00
|
|
|
|
|
|
|
const widget = {
|
|
|
|
api: "{url}/api/{endpoint}/wanted?apikey={key}",
|
|
|
|
proxyHandler: genericProxyHandler,
|
|
|
|
|
|
|
|
mappings: {
|
2022-09-26 12:04:37 +03:00
|
|
|
movies: {
|
2022-09-25 14:31:41 -07:00
|
|
|
endpoint: "movies",
|
|
|
|
map: (data) => ({
|
|
|
|
total: asJson(data).total,
|
|
|
|
}),
|
|
|
|
},
|
2022-09-26 12:04:37 +03:00
|
|
|
episodes: {
|
2022-09-25 14:31:41 -07:00
|
|
|
endpoint: "episodes",
|
|
|
|
map: (data) => ({
|
|
|
|
total: asJson(data).total,
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default widget;
|