mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 19:40:34 +00:00
refactor(admin): the admin routes other domains serve keep their DTOs in those domains
NotificationsController, SettingsController, OidcController and the packing template controller each imported their body DTO from admin/admin.dto.ts, and AdminController imported the same four without using them. Those imports tied the notifications, settings, packing and oidc domains to the admin domain and through it to everything admin depends on. The classes move unchanged (same names, same @trek/shared schemas) into each domain's own dto file.
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
|
||||
import { AdminGuard } from '../auth-core/admin.guard';
|
||||
import { NotificationPreferencesService } from './notification-preferences.service';
|
||||
import { AdminNotificationPreferencesDto, NotificationDefaultsUpdateDto } from '../admin/admin.dto';
|
||||
import { AdminNotificationPreferencesDto, NotificationDefaultsUpdateDto } from './notifications.dto';
|
||||
import { CurrentUser } from '../auth-core/current-user.decorator';
|
||||
import { ManagedForbidden } from '../common/managed';
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { createZodDto } from 'nestjs-zod';
|
||||
import {
|
||||
adminNotificationPreferencesRequestSchema,
|
||||
notificationDefaultsUpdateRequestSchema,
|
||||
preferencesUpdateRequestSchema,
|
||||
testSmtpRequestSchema,
|
||||
testWebhookRequestSchema,
|
||||
@@ -23,3 +25,7 @@ export class TestNtfyDto extends createZodDto(testNtfyRequestSchema) {}
|
||||
export class NotificationRespondDto extends createZodDto(notificationRespondRequestSchema) {}
|
||||
export class PushSubscribeDto extends createZodDto(pushSubscribeRequestSchema) {}
|
||||
export class PushUnsubscribeDto extends createZodDto(pushUnsubscribeRequestSchema) {}
|
||||
|
||||
/** The admin-side notification routes NotificationsController serves. */
|
||||
export class AdminNotificationPreferencesDto extends createZodDto(adminNotificationPreferencesRequestSchema) {}
|
||||
export class NotificationDefaultsUpdateDto extends createZodDto(notificationDefaultsUpdateRequestSchema) {}
|
||||
|
||||
Reference in New Issue
Block a user