mirror of
				https://github.com/gethomepage/homepage.git
				synced 2025-11-04 03:27:02 -05:00 
			
		
		
		
	Remove widget type passing
This commit is contained in:
		
							parent
							
								
									d42271acf6
								
							
						
					
					
						commit
						f13144ceb8
					
				@ -3,12 +3,17 @@ import createLogger from "utils/logger";
 | 
				
			|||||||
import genericProxyHandler from "utils/proxy/handlers/generic";
 | 
					import genericProxyHandler from "utils/proxy/handlers/generic";
 | 
				
			||||||
import widgets from "widgets/widgets";
 | 
					import widgets from "widgets/widgets";
 | 
				
			||||||
import calendarProxyHandler from "widgets/calendar/proxy";
 | 
					import calendarProxyHandler from "widgets/calendar/proxy";
 | 
				
			||||||
 | 
					import getServiceWidget from "utils/config/service-helpers";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const logger = createLogger("servicesProxy");
 | 
					const logger = createLogger("servicesProxy");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default async function handler(req, res) {
 | 
					export default async function handler(req, res) {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const { type } = req.query;
 | 
					    const { service, group } = req.query;
 | 
				
			||||||
 | 
					    const serviceWidget = await getServiceWidget(group, service);
 | 
				
			||||||
 | 
					    let type = serviceWidget?.type;
 | 
				
			||||||
 | 
					    // calendar is an alias for ical
 | 
				
			||||||
 | 
					    if (type === "calendar") type = "ical";
 | 
				
			||||||
    const widget = widgets[type];
 | 
					    const widget = widgets[type];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!widget) {
 | 
					    if (!widget) {
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,6 @@ export function formatApiCall(url, args) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export function getURLSearchParams(widget, endpoint) {
 | 
					export function getURLSearchParams(widget, endpoint) {
 | 
				
			||||||
  const params = new URLSearchParams({
 | 
					  const params = new URLSearchParams({
 | 
				
			||||||
    type: widget.type,
 | 
					 | 
				
			||||||
    group: widget.service_group,
 | 
					    group: widget.service_group,
 | 
				
			||||||
    service: widget.service_name,
 | 
					    service: widget.service_name,
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user