Skip to content

Instantly share code, notes, and snippets.

@seandearnaley
Created June 8, 2020 15:58
Show Gist options
  • Save seandearnaley/e16497a776bc52dd6f46520019437a73 to your computer and use it in GitHub Desktop.
Save seandearnaley/e16497a776bc52dd6f46520019437a73 to your computer and use it in GitHub Desktop.
card.model.ts (for Warthog)
import { BaseModel, IntField, Model, StringField, ManyToMany } from 'warthog';
import { Category } from '../category/category.model';
@Model()
export class Card extends BaseModel {
@IntField({ nullable: true })
number?: number;
@StringField({ nullable: true })
label?: string;
@ManyToMany(() => Category, (category: Category) => category.cards )
categorys?: Category[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment