0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Added type to prestige endpoint

This commit is contained in:
Chomp 2024-12-28 10:09:42 +00:00
parent b77c2825e3
commit 446dffba49
4 changed files with 10 additions and 11 deletions

View File

@ -2,9 +2,8 @@ import type { PrestigeController } from "@spt/controllers/PrestigeController";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
import type { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
import type { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
import type { INotifierChannel } from "@spt/models/eft/notifier/INotifier";
import { IGetPrestigeResponse } from "@spt/models/eft/prestige/IGetPrestigeResponse";
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
import { JsonUtil } from "@spt/utils/JsonUtil";
import { inject, injectable } from "tsyringe";
@injectable()
@ -12,7 +11,6 @@ export class PrestigeCallbacks {
constructor(
@inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("PrestigeController") protected prestigeController: PrestigeController,
) {}
@ -21,16 +19,12 @@ export class PrestigeCallbacks {
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<INotifierChannel> {
): IGetBodyResponseData<IGetPrestigeResponse> {
return this.httpResponse.getBody(this.prestigeController.getPrestige(sessionID, info));
}
/** Handle client/prestige/obtain */
public obtainPrestige(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<INotifierChannel> {
public obtainPrestige(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> {
return this.httpResponse.getBody(this.prestigeController.obtainPrestige(sessionID, info));
}
}

View File

@ -18,7 +18,6 @@ import type { IHideoutArea, IStage } from "@spt/models/eft/hideout/IHideoutArea"
import type { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData";
import type { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData";
import type { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import type { IHideoutCustomisationGlobal } from "@spt/models/eft/hideout/IHideoutCustomisation";
import type { IHideoutCustomizationApplyRequestData } from "@spt/models/eft/hideout/IHideoutCustomizationApplyRequestData";
import type { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData";
import type { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData";

View File

@ -4,6 +4,7 @@ import type { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { QuestHelper } from "@spt/helpers/QuestHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper";
import { IGetPrestigeResponse } from "@spt/models/eft/prestige/IGetPrestigeResponse";
import type { ILogger } from "@spt/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
import { SaveServer } from "@spt/servers/SaveServer";
@ -43,7 +44,7 @@ export class PrestigeController {
/**
* Handle /client/prestige/list
*/
public getPrestige(sessionID: string, info: any): any {
public getPrestige(sessionID: string, info: IEmptyRequestData): IGetPrestigeResponse {
return { elements: this.databaseService.getTemplates().prestige };
}

View File

@ -0,0 +1,5 @@
import { IPrestige } from "@spt/models/eft/common/tables/IPrestige";
export interface IGetPrestigeResponse {
elements: IPrestige;
}