Permalink
Browse files

Add a Faction model class

  • Loading branch information...
markerikson committed Dec 30, 2017
1 parent c8cabf2 commit 29eb97b0f341a5bdfa12d6a21511be9e48821801
Showing with 18 additions and 2 deletions.
  1. +2 −2 src/app/schema/schema.js
  2. +16 −0 src/features/unitInfo/Faction.js
View
@@ -4,9 +4,9 @@ import Pilot from "features/pilots/Pilot";
import MechDesign from "features/mechs/MechDesign";
import Mech from "features/mechs/Mech";
import Unit from "features/unitInfo/Unit";
import Faction from "features/unitInfo/Faction";
const orm = new ORM();
orm.register(Pilot, MechDesign, Mech, Unit);
orm.register(Pilot, MechDesign, Mech, Unit, Faction);
export default orm;
@@ -0,0 +1,16 @@
import {Model, attr} from "redux-orm";
export default class Faction extends Model {
static modelName = "Faction";
static fields = {
id : attr(),
name : attr(),
};
static parse(factionData) {
return this.upsert(factionData);
}
}

0 comments on commit 29eb97b

Please sign in to comment.