Improve typing
This commit is contained in:
parent
05c7cacdd1
commit
9bee9d20f7
9 changed files with 24 additions and 10 deletions
|
|
@ -2,6 +2,7 @@ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'type
|
|||
import { id } from '../id';
|
||||
import { Note } from './note';
|
||||
import { User } from './user';
|
||||
import { noteVisibilities } from '../../types';
|
||||
|
||||
@Entity()
|
||||
export class Poll {
|
||||
|
|
@ -34,10 +35,10 @@ export class Poll {
|
|||
|
||||
//#region Denormalized fields
|
||||
@Column('enum', {
|
||||
enum: ['public', 'home', 'followers', 'specified'],
|
||||
enum: noteVisibilities,
|
||||
comment: '[Denormalized]'
|
||||
})
|
||||
public noteVisibility: 'public' | 'home' | 'followers' | 'specified';
|
||||
public noteVisibility: typeof noteVisibilities[number];
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue