Enhancement: multiple widgets per service (#4338)
Some checks are pending
Docker / Linting Checks (push) Waiting to run
Docker / Docker Build & Push (push) Blocked by required conditions

This commit is contained in:
shamoon
2024-11-27 02:33:40 -08:00
parent 385511f773
commit 907abee1aa
46 changed files with 210 additions and 169 deletions

View File

@@ -7,13 +7,13 @@ import getServiceWidget from "utils/config/service-helpers";
const logger = createLogger("xteveProxyHandler");
export default async function xteveProxyHandler(req, res) {
const { group, service } = req.query;
const { group, service, index } = req.query;
if (!group || !service) {
return res.status(400).json({ error: "Invalid proxy service type" });
}
const widget = await getServiceWidget(group, service);
const widget = await getServiceWidget(group, service, index);
const api = widgets?.[widget.type]?.api;
if (!api) {
return res.status(403).json({ error: "Service does not support API calls" });