move getMaxStanding to a new syndicateStandingHelper
This commit is contained in:
parent
29206f142d
commit
e8b2b0a3f1
@ -3,7 +3,8 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
|
|||||||
import { addMiscItems, getInventory, getStandingLimit, updateStandingLimit } from "@/src/services/inventoryService";
|
import { addMiscItems, getInventory, getStandingLimit, updateStandingLimit } from "@/src/services/inventoryService";
|
||||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { ExportSyndicates, ISyndicate } from "warframe-public-export-plus";
|
import { ExportSyndicates } from "warframe-public-export-plus";
|
||||||
|
import { getMaxStanding } from "@/src/helpers/syndicateStandingHelper";
|
||||||
|
|
||||||
export const syndicateStandingBonusController: RequestHandler = async (req, res) => {
|
export const syndicateStandingBonusController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -67,14 +68,3 @@ interface ISyndicateStandingBonusRequest {
|
|||||||
};
|
};
|
||||||
ModularWeaponId: IOid; // Seems to just be "000000000000000000000000", also note there's a "Category" query field
|
ModularWeaponId: IOid; // Seems to just be "000000000000000000000000", also note there's a "Category" query field
|
||||||
}
|
}
|
||||||
|
|
||||||
const getMaxStanding = (syndicate: ISyndicate, title: number): number => {
|
|
||||||
if (!syndicate.titles) {
|
|
||||||
// LibrarySyndicate
|
|
||||||
return 125000;
|
|
||||||
}
|
|
||||||
if (title == 0) {
|
|
||||||
return syndicate.titles.find(x => x.level == 1)!.minStanding;
|
|
||||||
}
|
|
||||||
return syndicate.titles.find(x => x.level == title)!.maxStanding;
|
|
||||||
};
|
|
||||||
|
12
src/helpers/syndicateStandingHelper.ts
Normal file
12
src/helpers/syndicateStandingHelper.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { ISyndicate } from "warframe-public-export-plus";
|
||||||
|
|
||||||
|
export const getMaxStanding = (syndicate: ISyndicate, title: number): number => {
|
||||||
|
if (!syndicate.titles) {
|
||||||
|
// LibrarySyndicate
|
||||||
|
return 125000;
|
||||||
|
}
|
||||||
|
if (title == 0) {
|
||||||
|
return syndicate.titles.find(x => x.level == 1)!.minStanding;
|
||||||
|
}
|
||||||
|
return syndicate.titles.find(x => x.level == title)!.maxStanding;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user