diff --git a/src/controllers/api/setSupportedSyndicateController.ts b/src/controllers/api/setSupportedSyndicateController.ts new file mode 100644 index 00000000..78ef26f3 --- /dev/null +++ b/src/controllers/api/setSupportedSyndicateController.ts @@ -0,0 +1,9 @@ +import { RequestHandler } from "express"; +import { getInventory } from "@/src/services/inventoryService"; + +export const setSupportedSyndicateController: RequestHandler = async (req, res) => { + const inventory = await getInventory(req.query.accountId as string); + inventory.SupportedSyndicate = req.query.syndicate as string; + await inventory.save(); + res.end(); +}; diff --git a/src/models/inventoryModels/inventoryModel.ts b/src/models/inventoryModels/inventoryModel.ts index 287ce62e..43f15819 100644 --- a/src/models/inventoryModels/inventoryModel.ts +++ b/src/models/inventoryModels/inventoryModel.ts @@ -645,6 +645,8 @@ const inventorySchema = new Schema( //Curent trade info Giving or Getting items PendingTrades: [Schema.Types.Mixed], + //Syndicate currently being pledged to. + SupportedSyndicate: String, //Curent Syndicates rank\exp Affiliations: [affiliationsSchema], //Syndicates Missions complate(Navigation->Syndicate) diff --git a/src/routes/api.ts b/src/routes/api.ts index c8fa928e..8212ebc1 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -46,6 +46,7 @@ import { addFriendImageController } from "@/src/controllers/api/addFriendImageCo import { createGuildController } from "@/src/controllers/api/createGuildController"; import { sellController } from "@/src/controllers/api/sellController"; import { upgradesController } from "@/src/controllers/api/upgradesController"; +import { setSupportedSyndicateController } from "@/src/controllers/api/setSupportedSyndicateController"; const apiRouter = express.Router(); @@ -73,6 +74,7 @@ apiRouter.get("/logout.php", logoutController); apiRouter.get("/setBootLocation.php", setBootLocationController); apiRouter.get("/setActiveShip.php", setActiveShipController); apiRouter.get("/getGuild.php", getGuildController); +apiRouter.get("/setSupportedSyndicate.php", setSupportedSyndicateController); // post // eslint-disable-next-line @typescript-eslint/no-misused-promises diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index 38a0041f..5fce938b 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -190,6 +190,7 @@ export interface IInventoryResponse { Boosters: IBooster[]; ActiveDojoColorResearch: string; SentientSpawnChanceBoosters: ISentientSpawnChanceBoosters; + SupportedSyndicate?: string; Affiliations: IAffiliation[]; QualifyingInvasions: any[]; FactionScores: number[];