fix(routes): complete post-refactor dependency wiring cleanup
This commit is contained in:
@@ -28,7 +28,7 @@ module.exports = function(ctx) {
|
||||
const results = { radarr: null, sonarr: null };
|
||||
|
||||
// Step 1: Authenticate with Overseerr via Plex token
|
||||
let overseerrUrl = `http://host.docker.internal:${APP_PORTS.overseerr}`;
|
||||
const overseerrUrl = `http://host.docker.internal:${APP_PORTS.overseerr}`;
|
||||
const overseerrSession = await helpers.getOverseerrSession();
|
||||
|
||||
if (!overseerrSession) {
|
||||
@@ -227,7 +227,7 @@ module.exports = function(ctx) {
|
||||
}
|
||||
|
||||
// Normalize URL - remove trailing slash
|
||||
let baseUrl = url.replace(/\/+$/, '');
|
||||
const baseUrl = url.replace(/\/+$/, '');
|
||||
|
||||
// Build the API endpoint
|
||||
let apiEndpoint;
|
||||
|
||||
@@ -9,12 +9,18 @@ const { APP_PORTS } = require('../../constants');
|
||||
* @param {Function} deps.errorResponse - Error response helper
|
||||
* @param {Object} deps.log - Logger instance
|
||||
* @param {Object} deps.helpers - Arr helpers module
|
||||
* @param {Object} deps.credentialManager - Credential manager
|
||||
* @param {Object} deps.servicesStateManager - Services state manager
|
||||
* @returns {express.Router}
|
||||
*/
|
||||
module.exports = function(ctx) {
|
||||
const { fetchT, asyncHandler, errorResponse, log, helpers } = ctx;
|
||||
module.exports = function({ fetchT, asyncHandler, errorResponse, log: _log, helpers, credentialManager, servicesStateManager }) {
|
||||
const router = express.Router();
|
||||
|
||||
const ctx = {
|
||||
credentialManager,
|
||||
servicesStateManager
|
||||
};
|
||||
|
||||
// Plex Libraries endpoint
|
||||
router.get('/plex/libraries', asyncHandler(async (req, res) => {
|
||||
// Get Plex token
|
||||
|
||||
@@ -10,12 +10,18 @@ const { APP_PORTS } = require('../../constants');
|
||||
* @param {Function} deps.errorResponse - Error response helper
|
||||
* @param {Object} deps.log - Logger instance
|
||||
* @param {Object} deps.helpers - Arr helpers module
|
||||
* @param {Object} deps.servicesStateManager - Services state manager
|
||||
* @param {Object} deps.notification - Notification helper
|
||||
* @returns {express.Router}
|
||||
*/
|
||||
module.exports = function(ctx) {
|
||||
const { credentialManager, fetchT, asyncHandler, errorResponse, log, helpers } = ctx;
|
||||
module.exports = function({ credentialManager, servicesStateManager, fetchT, asyncHandler, errorResponse: _errorResponse, log: _log, helpers, notification }) {
|
||||
const router = express.Router();
|
||||
|
||||
const ctx = {
|
||||
servicesStateManager,
|
||||
notification
|
||||
};
|
||||
|
||||
// Smart Connect: Unified orchestration endpoint
|
||||
router.post('/arr/smart-connect', asyncHandler(async (req, res) => {
|
||||
const { services: inputServices, configurePlex, configureProwlarr, configureSeerr, saveCredentials } = req.body;
|
||||
|
||||
Reference in New Issue
Block a user