@relationc/tags
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Tag Service

Tag manager for project: NestJs, TypeORM, PostgresQL

Install

npm install crm-tags
# With yarn
yarn add crm-tags

Usage

Register module
@Module({
  imports: [
    ResourceTagModule.register(Mock), // + Add this
    TypeOrmModule.forFeature([Mock]),
  ],
  controllers: [MockController],
})
export class MockModule {}
Update entity
@Entity('mock_tags')
export class Mock {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  description: string;

  // + Add this
  @TagRelation(Mock)
  tags: ResourceTag[];

  // + Add this
  @FilterTag('mock_tags')
  async filterTag() {}
}
Add where in query ( This will be upgrade and make auto )
this.mockRepository.find({
  where: {
    tags: {
      resource: 'mock_tags', // + Add this
    },
  },
});

/@relationc/tags/

    Package Sidebar

    Install

    npm i @relationc/tags

    Weekly Downloads

    1

    Version

    1.1.4

    License

    none

    Unpacked Size

    70.6 kB

    Total Files

    85

    Last publish

    Collaborators

    • hoaian412003