Setup route to allow switching of profile icon. (!369)

Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/369
This commit is contained in:
Kaeno 2024-07-07 13:07:36 +00:00
parent 291edbb75b
commit fba0f4703a
3 changed files with 7 additions and 6 deletions

View File

@ -167,10 +167,10 @@ export class ProfileCallbacks
url: string, url: string,
info: IGetProfileSettingsRequest, info: IGetProfileSettingsRequest,
sessionId: string, sessionId: string,
): IGetBodyResponseData<string> ): IGetBodyResponseData<boolean>
{ {
this.profileController.setChosenProfileIcon(sessionId, info);
return this.httpResponse.emptyResponse(); return this.httpResponse.getBody(this.profileController.setChosenProfileIcon(sessionId, info));
} }
/** /**

View File

@ -489,14 +489,15 @@ export class ProfileController
/** /**
* Handle client/profile/settings * Handle client/profile/settings
*/ */
public setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void public setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): boolean
{ {
const profileToUpdate = this.profileHelper.getPmcProfile(sessionId); const profileToUpdate = this.profileHelper.getPmcProfile(sessionId);
if (!profileToUpdate) if (!profileToUpdate)
{ {
return; return false;
} }
profileToUpdate.Info.SelectedMemberCategory = request.memberCategory; profileToUpdate.Info.SelectedMemberCategory = request.memberCategory;
return true;
} }
} }

View File

@ -126,7 +126,7 @@ export class ProfileStaticRouter extends StaticRouter
info: any, info: any,
sessionID: string, sessionID: string,
output: string, output: string,
): Promise<IGetBodyResponseData<string>> => ): Promise<IGetBodyResponseData<boolean>> =>
{ {
return this.profileCallbacks.getProfileSettings(url, info, sessionID); return this.profileCallbacks.getProfileSettings(url, info, sessionID);
}, },