mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +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:
@@ -1,7 +1,7 @@
|
||||
import { Body, Controller, Delete, Get, HttpCode, HttpException, Param, Post, Put, Req, UseGuards } from '@nestjs/common';
|
||||
import type { Request } from 'express';
|
||||
import { PackingService } from './packing.service';
|
||||
import { AdminTemplateNameDto } from '../admin/admin.dto';
|
||||
import { AdminTemplateNameDto } from './packing.dto';
|
||||
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
|
||||
import { AdminGuard } from '../auth-core/admin.guard';
|
||||
import { CurrentUser } from '../auth-core/current-user.decorator';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createZodDto } from 'nestjs-zod';
|
||||
import {
|
||||
adminTemplateNameRequestSchema,
|
||||
packingCreateItemRequestSchema,
|
||||
packingUpdateItemRequestSchema,
|
||||
packingSetSharingRequestSchema,
|
||||
@@ -30,3 +31,6 @@ export class PackingBagMembersDto extends createZodDto(packingBagMembersRequestS
|
||||
export class PackingSaveTemplateDto extends createZodDto(packingSaveTemplateRequestSchema) {}
|
||||
export class PackingApplyTemplateDto extends createZodDto(packingApplyTemplateRequestSchema) {}
|
||||
export class PackingCategoryAssigneesDto extends createZodDto(packingCategoryAssigneesRequestSchema) {}
|
||||
|
||||
/** The six packing-template create/update routes of AdminPackingTemplatesController share this body. */
|
||||
export class AdminTemplateNameDto extends createZodDto(adminTemplateNameRequestSchema) {}
|
||||
|
||||
Reference in New Issue
Block a user