mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-13 23:35:39 +01:00
fix prefeneces
This commit is contained in:
@@ -4,7 +4,7 @@ import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
@Entity()
|
||||
export class ESysPreferenceBackend extends ESysPreference {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id: string;
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ nullable: false, unique: true })
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Column, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
export class EUsrPreferenceBackend extends EUsrPreference {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id: string;
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ nullable: false, unique: true })
|
||||
|
||||
@@ -66,7 +66,10 @@ export class SettingsSysprefOptionComponent implements OnInit {
|
||||
}
|
||||
|
||||
numberUpdateWrapper(e: Event) {
|
||||
this.update((e.target as HTMLInputElement).valueAsNumber);
|
||||
const value = (e.target as HTMLInputElement).valueAsNumber;
|
||||
if (isNaN(value)) return;
|
||||
|
||||
this.update(value);
|
||||
}
|
||||
|
||||
private async updatePreference(value: PrefValueType) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { EntityID } from '../validators/entity-id.validator';
|
||||
import { EntityIDOptional } from '../validators/entity-id.validator';
|
||||
|
||||
export class ESysPreference {
|
||||
@EntityID()
|
||||
id: string;
|
||||
@EntityIDOptional()
|
||||
id?: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { IsDefined, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { EntityID } from '../validators/entity-id.validator';
|
||||
import { EntityIDOptional } from '../validators/entity-id.validator';
|
||||
import { IsPosInt } from '../validators/positive-int.validator';
|
||||
|
||||
export class EUsrPreference {
|
||||
@EntityID()
|
||||
id: string;
|
||||
@EntityIDOptional()
|
||||
id?: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { IsNotEmpty, IsUUID } from 'class-validator';
|
||||
import { IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
|
||||
import { CombinePDecorators } from '../util/decorator';
|
||||
|
||||
export const EntityID = CombinePDecorators(IsNotEmpty(), IsUUID('4'));
|
||||
export const EntityIDOptional = CombinePDecorators(IsOptional(), IsUUID('4'));
|
||||
|
||||
Reference in New Issue
Block a user