返回提交历史
Added
src/controllers/api/setSupportedSyndicateController.ts
+9
-0
Modified
src/models/inventoryModels/inventoryModel.ts
+2
-0
Modified
src/routes/api.ts
+2
-0
Modified
src/types/inventoryTypes/inventoryTypes.ts
+1
-0
XFEstudio/XFESpaceNinjaServer
feat: implement pledging to syndicate (#162)
fd56203f
代码差异
4 个文件
+14
-0
@@ -0,0 +1,9 @@
1
import { RequestHandler } from "express";
2
import { getInventory } from "@/src/services/inventoryService";
3
4
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
5
const inventory = await getInventory(req.query.accountId as string);
6
inventory.SupportedSyndicate = req.query.syndicate as string;
7
await inventory.save();
8
res.end();
9
};
@@ -645,6 +645,8 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
645
645
//Curent trade info Giving or Getting items
646
646
PendingTrades: [Schema.Types.Mixed],
647
647
648
//Syndicate currently being pledged to.
649
SupportedSyndicate: String,
648
650
//Curent Syndicates rank\exp
649
651
Affiliations: [affiliationsSchema],
650
652
//Syndicates Missions complate(Navigation->Syndicate)
@@ -46,6 +46,7 @@ import { addFriendImageController } from "@/src/controllers/api/addFriendImageCo
46
46
import { createGuildController } from "@/src/controllers/api/createGuildController";
47
47
import { sellController } from "@/src/controllers/api/sellController";
48
48
import { upgradesController } from "@/src/controllers/api/upgradesController";
49
import { setSupportedSyndicateController } from "@/src/controllers/api/setSupportedSyndicateController";
49
50
50
51
const apiRouter = express.Router();
51
52
@@ -73,6 +74,7 @@ apiRouter.get("/logout.php", logoutController);
73
74
apiRouter.get("/setBootLocation.php", setBootLocationController);
74
75
apiRouter.get("/setActiveShip.php", setActiveShipController);
75
76
apiRouter.get("/getGuild.php", getGuildController);
77
apiRouter.get("/setSupportedSyndicate.php", setSupportedSyndicateController);
76
78
77
79
// post
78
80
// eslint-disable-next-line @typescript-eslint/no-misused-promises
@@ -190,6 +190,7 @@ export interface IInventoryResponse {
190
190
Boosters: IBooster[];
191
191
ActiveDojoColorResearch: string;
192
192
SentientSpawnChanceBoosters: ISentientSpawnChanceBoosters;
193
SupportedSyndicate?: string;
193
194
Affiliations: IAffiliation[];
194
195
QualifyingInvasions: any[];
195
196
FactionScores: number[];