rule book ui
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import {ruleBookControllerApi} from "@/mammon";
|
||||
import {RuleBookResponse, RuleSetResponse} from "@/generated/mammon";
|
||||
|
||||
export const activityTypes = {
|
||||
itemBought: "ITEM_BOUGHT",
|
||||
itemSold: "ITEM_SOLD",
|
||||
bountyEarned: "BOUNTY_EARNED",
|
||||
itemManufactured: "ITEM_MANUFACTURED"
|
||||
} as const;
|
||||
|
||||
export type ActivityType = typeof activityTypes[keyof typeof activityTypes];
|
||||
export type RuleBook = RuleBookResponse & { ruleSets: { [key: ActivityType]: RuleSetResponse; } }
|
||||
|
||||
export const findByCharacterId = (characterId: number): Promise<RuleBook> => ruleBookControllerApi.findByCharacterId(characterId)
|
||||
.then(response => response.data)
|
||||
.catch(() => ({characterId, ruleSets: {}}));
|
||||
Reference in New Issue
Block a user