feat: implement pledging to syndicate #162
							
								
								
									
										9
									
								
								src/controllers/api/setSupportedSyndicateController.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/controllers/api/setSupportedSyndicateController.ts
									
									
									
									
									
										Normal file
									
								
							@ -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();
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@ -645,6 +645,8 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        //Curent trade info Giving or Getting items
 | 
					        //Curent trade info Giving or Getting items
 | 
				
			||||||
        PendingTrades: [Schema.Types.Mixed],
 | 
					        PendingTrades: [Schema.Types.Mixed],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Syndicate currently being pledged to.
 | 
				
			||||||
 | 
					        SupportedSyndicate: String,
 | 
				
			||||||
        //Curent Syndicates rank\exp
 | 
					        //Curent Syndicates rank\exp
 | 
				
			||||||
        Affiliations: [affiliationsSchema],
 | 
					        Affiliations: [affiliationsSchema],
 | 
				
			||||||
        //Syndicates Missions complate(Navigation->Syndicate)
 | 
					        //Syndicates Missions complate(Navigation->Syndicate)
 | 
				
			||||||
 | 
				
			|||||||
@ -46,6 +46,7 @@ import { addFriendImageController } from "@/src/controllers/api/addFriendImageCo
 | 
				
			|||||||
import { createGuildController } from "@/src/controllers/api/createGuildController";
 | 
					import { createGuildController } from "@/src/controllers/api/createGuildController";
 | 
				
			||||||
import { sellController } from "@/src/controllers/api/sellController";
 | 
					import { sellController } from "@/src/controllers/api/sellController";
 | 
				
			||||||
import { upgradesController } from "@/src/controllers/api/upgradesController";
 | 
					import { upgradesController } from "@/src/controllers/api/upgradesController";
 | 
				
			||||||
 | 
					import { setSupportedSyndicateController } from "@/src/controllers/api/setSupportedSyndicateController";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const apiRouter = express.Router();
 | 
					const apiRouter = express.Router();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -73,6 +74,7 @@ apiRouter.get("/logout.php", logoutController);
 | 
				
			|||||||
apiRouter.get("/setBootLocation.php", setBootLocationController);
 | 
					apiRouter.get("/setBootLocation.php", setBootLocationController);
 | 
				
			||||||
apiRouter.get("/setActiveShip.php", setActiveShipController);
 | 
					apiRouter.get("/setActiveShip.php", setActiveShipController);
 | 
				
			||||||
apiRouter.get("/getGuild.php", getGuildController);
 | 
					apiRouter.get("/getGuild.php", getGuildController);
 | 
				
			||||||
 | 
					apiRouter.get("/setSupportedSyndicate.php", setSupportedSyndicateController);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// post
 | 
					// post
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
 | 
					// eslint-disable-next-line @typescript-eslint/no-misused-promises
 | 
				
			||||||
 | 
				
			|||||||
@ -191,6 +191,7 @@ export interface IInventoryResponse {
 | 
				
			|||||||
    Boosters: IBooster[];
 | 
					    Boosters: IBooster[];
 | 
				
			||||||
    ActiveDojoColorResearch: string;
 | 
					    ActiveDojoColorResearch: string;
 | 
				
			||||||
    SentientSpawnChanceBoosters: ISentientSpawnChanceBoosters;
 | 
					    SentientSpawnChanceBoosters: ISentientSpawnChanceBoosters;
 | 
				
			||||||
 | 
					    SupportedSyndicate?: string;
 | 
				
			||||||
    Affiliations: IAffiliation[];
 | 
					    Affiliations: IAffiliation[];
 | 
				
			||||||
    QualifyingInvasions: any[];
 | 
					    QualifyingInvasions: any[];
 | 
				
			||||||
    FactionScores: number[];
 | 
					    FactionScores: number[];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user