mirror of
https://github.com/docmost/docmost.git
synced 2026-07-27 06:54:52 +10:00
feat(base): allow type on /properties/update, restricted to user types
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
import {
|
import {
|
||||||
IsEmpty,
|
IsIn,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsObject,
|
IsObject,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
IsUUID,
|
IsUUID,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
|
import {
|
||||||
|
USER_PROPERTY_TYPES,
|
||||||
|
BasePropertyTypeValue,
|
||||||
|
} from '../base.schemas';
|
||||||
|
|
||||||
export class UpdatePropertyDto {
|
export class UpdatePropertyDto {
|
||||||
@IsUUID()
|
@IsUUID()
|
||||||
@@ -19,15 +23,9 @@ export class UpdatePropertyDto {
|
|||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
||||||
/*
|
@IsOptional()
|
||||||
* Type changes are intentionally not exposed via the API in v1. The
|
@IsIn(USER_PROPERTY_TYPES)
|
||||||
* conversion engine in apps/server/src/core/base/engine/ and the
|
type?: BasePropertyTypeValue;
|
||||||
* worker in tasks/base-type-conversion.task.ts remain intact for
|
|
||||||
* a future v2 re-wire. Requests including `type` are rejected here
|
|
||||||
* so the service's type-change branches stay unreachable.
|
|
||||||
*/
|
|
||||||
@IsEmpty()
|
|
||||||
type?: string;
|
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsObject()
|
@IsObject()
|
||||||
|
|||||||
Reference in New Issue
Block a user