Created
June 8, 2020 15:58
-
-
Save seandearnaley/e16497a776bc52dd6f46520019437a73 to your computer and use it in GitHub Desktop.
card.model.ts (for Warthog)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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