mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
19 lines
420 B
TypeScript
19 lines
420 B
TypeScript
import { Card } from 'types';
|
|
|
|
import { dexieService } from '../DexieService';
|
|
|
|
export class CardDTO extends Card {
|
|
save() {
|
|
return dexieService.cards.put(this);
|
|
}
|
|
|
|
static get(name) {
|
|
return dexieService.cards.where('name').equalsIgnoreCase(name).first();
|
|
}
|
|
|
|
static bulkAdd(cards: CardDTO[]): Promise<any> {
|
|
return dexieService.cards.bulkPut(cards);
|
|
}
|
|
};
|
|
|
|
dexieService.cards.mapToClass(CardDTO);
|