Add library items to /admin
This commit is contained in:
@ -50,6 +50,7 @@ export const registerDatabase = async (secrets: any): Promise<Connection> => {
|
|||||||
Group,
|
Group,
|
||||||
Integration,
|
Integration,
|
||||||
Subscription,
|
Subscription,
|
||||||
|
LibraryItem,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -308,3 +309,46 @@ export class Subscription extends BaseEntity {
|
|||||||
@Column({ type: 'timestamp', name: 'updated_at' })
|
@Column({ type: 'timestamp', name: 'updated_at' })
|
||||||
updatedAt!: Date
|
updatedAt!: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Entity({ name: 'library_item' })
|
||||||
|
export class LibraryItem {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id!: string
|
||||||
|
|
||||||
|
@JoinColumn({ name: 'user_id' })
|
||||||
|
@ManyToOne(() => User, (user) => user.articles, { eager: true })
|
||||||
|
user!: User
|
||||||
|
|
||||||
|
@Column('text')
|
||||||
|
originalUrl!: string
|
||||||
|
|
||||||
|
@Column('text')
|
||||||
|
slug!: string
|
||||||
|
|
||||||
|
@Column('text')
|
||||||
|
title!: string
|
||||||
|
|
||||||
|
@Column('text', { nullable: true })
|
||||||
|
author?: string | null
|
||||||
|
|
||||||
|
@Column('text', { nullable: true })
|
||||||
|
siteName?: string | null
|
||||||
|
|
||||||
|
@Column('text')
|
||||||
|
itemType!: string
|
||||||
|
|
||||||
|
@Column('text', { nullable: true })
|
||||||
|
subscription?: string | null
|
||||||
|
|
||||||
|
@Column({ type: 'timestamp', name: 'saved_at' })
|
||||||
|
savedAt!: Date
|
||||||
|
|
||||||
|
@Column({ type: 'timestamp', name: 'deleted_at' })
|
||||||
|
deletedAt?: Date | null
|
||||||
|
|
||||||
|
@Column({ type: 'timestamp', name: 'created_at' })
|
||||||
|
createdAt!: Date
|
||||||
|
|
||||||
|
@Column({ type: 'timestamp', name: 'updated_at' })
|
||||||
|
updatedAt!: Date
|
||||||
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import {
|
|||||||
ContentDisplayReport,
|
ContentDisplayReport,
|
||||||
Subscription,
|
Subscription,
|
||||||
Integration,
|
Integration,
|
||||||
|
LibraryItem,
|
||||||
} from './db'
|
} from './db'
|
||||||
import { compare, hashSync } from 'bcryptjs'
|
import { compare, hashSync } from 'bcryptjs'
|
||||||
const readYamlFile = require('read-yaml-file')
|
const readYamlFile = require('read-yaml-file')
|
||||||
@ -41,6 +42,7 @@ const ADMIN_USER_EMAIL =
|
|||||||
{ resource: Group, options: { parent: { name: 'Users' } } },
|
{ resource: Group, options: { parent: { name: 'Users' } } },
|
||||||
{ resource: Subscription, options: { parent: { name: 'Users' } } },
|
{ resource: Subscription, options: { parent: { name: 'Users' } } },
|
||||||
{ resource: Integration, options: { parent: { name: 'Users' } } },
|
{ resource: Integration, options: { parent: { name: 'Users' } } },
|
||||||
|
{ resource: LibraryItem, options: { parent: { name: 'Users' } } },
|
||||||
{
|
{
|
||||||
resource: ContentDisplayReport,
|
resource: ContentDisplayReport,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user