mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +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:
@@ -3,8 +3,7 @@ import type { Request } from 'express';
|
||||
import { MASKED_SETTING_VALUE } from '@trek/shared';
|
||||
import type { User } from '../../types';
|
||||
import { SettingsService, isAdminOnlyEndpointSetting } from './settings.service';
|
||||
import { SettingUpsertDto, SettingsBulkDto } from './settings.dto';
|
||||
import { AdminDefaultUserSettingsDto } from '../admin/admin.dto';
|
||||
import { AdminDefaultUserSettingsDto, SettingUpsertDto, SettingsBulkDto } from './settings.dto';
|
||||
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
|
||||
import { AdminGuard } from '../auth-core/admin.guard';
|
||||
import { AuditService } from '../audit/audit.service';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createZodDto } from 'nestjs-zod';
|
||||
import { settingUpsertRequestSchema, settingsBulkRequestSchema } from '@trek/shared';
|
||||
import { adminDefaultUserSettingsRequestSchema, settingUpsertRequestSchema, settingsBulkRequestSchema } from '@trek/shared';
|
||||
|
||||
/**
|
||||
* Server-side createZodDto wrappers over the @trek/shared settings contracts.
|
||||
@@ -9,3 +9,6 @@ import { settingUpsertRequestSchema, settingsBulkRequestSchema } from '@trek/sha
|
||||
*/
|
||||
export class SettingUpsertDto extends createZodDto(settingUpsertRequestSchema) {}
|
||||
export class SettingsBulkDto extends createZodDto(settingsBulkRequestSchema) {}
|
||||
|
||||
/** The admin route for the instance-wide user-setting defaults. */
|
||||
export class AdminDefaultUserSettingsDto extends createZodDto(adminDefaultUserSettingsRequestSchema) {}
|
||||
|
||||
Reference in New Issue
Block a user