mirror of
https://github.com/docmost/docmost.git
synced 2025-11-23 14:11:08 +10:00
feat: groups
This commit is contained in:
8
apps/server/src/core/group/dto/add-group-user.dto.ts
Normal file
8
apps/server/src/core/group/dto/add-group-user.dto.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
import { GroupIdDto } from './group-id.dto';
|
||||
|
||||
export class AddGroupUserDto extends GroupIdDto {
|
||||
@IsNotEmpty()
|
||||
@IsUUID()
|
||||
userId: string;
|
||||
}
|
||||
12
apps/server/src/core/group/dto/create-group.dto.ts
Normal file
12
apps/server/src/core/group/dto/create-group.dto.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
||||
|
||||
export class CreateGroupDto {
|
||||
@MinLength(2)
|
||||
@MaxLength(64)
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
}
|
||||
7
apps/server/src/core/group/dto/group-id.dto.ts
Normal file
7
apps/server/src/core/group/dto/group-id.dto.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
|
||||
export class GroupIdDto {
|
||||
@IsNotEmpty()
|
||||
@IsUUID()
|
||||
groupId: string;
|
||||
}
|
||||
3
apps/server/src/core/group/dto/remove-group-user.dto.ts
Normal file
3
apps/server/src/core/group/dto/remove-group-user.dto.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { AddGroupUserDto } from './add-group-user.dto';
|
||||
|
||||
export class RemoveGroupUserDto extends AddGroupUserDto {}
|
||||
4
apps/server/src/core/group/dto/update-group.dto.ts
Normal file
4
apps/server/src/core/group/dto/update-group.dto.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateGroupDto } from './create-group.dto';
|
||||
|
||||
export class UpdateGroupDto extends PartialType(CreateGroupDto) {}
|
||||
Reference in New Issue
Block a user