mirror of
https://github.com/CaramelFur/Picsur.git
synced 2026-05-07 05:07:40 +02:00
change from incremental id to uuid-v4
This commit is contained in:
@@ -4,7 +4,7 @@ import { EntityID } from '../validators/entity-id.validator';
|
||||
|
||||
export class EImage {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsHash('sha256')
|
||||
hash: string;
|
||||
|
||||
@@ -19,5 +19,5 @@ export class RoleNamePermsObject extends RoleNameObject {
|
||||
|
||||
export class ERole extends RoleNamePermsObject {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { EntityID } from '../validators/entity-id.validator';
|
||||
|
||||
export class ESysPreference {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
||||
@@ -28,7 +28,7 @@ export class NameRolesUser extends UsernameUser {
|
||||
// Actual entity that goes in the db
|
||||
export class EUser extends NameRolesUser {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Exclude()
|
||||
|
||||
@@ -4,7 +4,7 @@ import { IsPosInt } from '../validators/positive-int.validator';
|
||||
|
||||
export class EUsrPreference {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IsInt, IsNotEmpty, IsOptional, Min } from 'class-validator';
|
||||
import { IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
|
||||
import { CombinePDecorators } from '../util/decorator';
|
||||
|
||||
export const EntityID = CombinePDecorators(IsOptional(), IsInt(), Min(0));
|
||||
export const EntityIDRequired = CombinePDecorators(IsNotEmpty(), IsInt(), Min(0));
|
||||
export const EntityID = CombinePDecorators(IsOptional(), IsUUID('4'));
|
||||
export const EntityIDRequired = CombinePDecorators(IsNotEmpty(), IsUUID('4'));
|
||||
|
||||
Reference in New Issue
Block a user