mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
Merge pull request #1179 from ajnart/fix/dns-hole-reversed-controls
🐛 Fix reversed dns-hole controls
This commit is contained in:
@@ -5,13 +5,14 @@ import { AdGuard } from '~/tools/server/sdk/adGuard/adGuard';
|
||||
import { PiHoleClient } from '~/tools/server/sdk/pihole/piHole';
|
||||
import { ConfigAppType } from '~/types/app';
|
||||
import { AdStatistics } from '~/widgets/dnshole/type';
|
||||
|
||||
import { createTRPCRouter, publicProcedure } from '../trpc';
|
||||
|
||||
export const dnsHoleRouter = createTRPCRouter({
|
||||
control: publicProcedure
|
||||
.input(
|
||||
z.object({
|
||||
status: z.enum(['enabled', 'disabled']),
|
||||
action: z.enum(['enable', 'disable']),
|
||||
configName: z.string(),
|
||||
})
|
||||
)
|
||||
@@ -25,11 +26,11 @@ export const dnsHoleRouter = createTRPCRouter({
|
||||
await Promise.all(
|
||||
applicableApps.map(async (app) => {
|
||||
if (app.integration?.type === 'pihole') {
|
||||
await processPiHole(app, input.status === 'disabled');
|
||||
await processPiHole(app, input.action === 'enable');
|
||||
return;
|
||||
}
|
||||
|
||||
await processAdGuard(app, input.status === 'disabled');
|
||||
await processAdGuard(app, input.action === 'enable');
|
||||
})
|
||||
);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user