fix: Unable to save settings when accepting trade policy. #966

Merged
OrdisPrime merged 5 commits from CyberVenom/SpaceNinjaServer:main into main 2025-02-19 14:09:02 -08:00
Contributor

image.png

![image.png](/attachments/b9954b5f-5ece-4803-b728-548ca2320fdf)
314 KiB
CyberVenom added 1 commit 2025-02-19 11:36:33 -08:00
fix: Unable to save settings when accepting trade policy.
All checks were successful
Build / build (22) (pull_request) Successful in 56s
Build / build (20) (pull_request) Successful in 1m13s
Build / build (18) (pull_request) Successful in 36s
6c6403f460
OrdisPrime reviewed 2025-02-19 11:56:03 -08:00
@ -0,0 +14,4 @@
const trainingResults = getJSONfromString<ISaveSettingsRequest>(String(req.body));
const inventory = await getInventory(accountId);
inventory.Settings = trainingResults.Settings;
Owner

training results?

training results?
Author
Contributor

The client wil send the full settings object like so
{"Settings":{"GiftMode":"GIFT_MODE_ALL","FriendInvRestriction":"GIFT_MODE_ALL","GuildInvRestriction":"GIFT_MODE_ALL","ShowFriendInvNotifications":true,"TradingRulesConfirmed":true,"SubscribedToSurveys":true}}

The client wil send the full settings object like so {"Settings":{"GiftMode":"GIFT_MODE_ALL","FriendInvRestriction":"GIFT_MODE_ALL","GuildInvRestriction":"GIFT_MODE_ALL","ShowFriendInvNotifications":true,"TradingRulesConfirmed":true,"SubscribedToSurveys":true}}
Owner

yea that all makes sense, I was just wondering why its called training results :D

yea that all makes sense, I was just wondering why its called training results :D
Owner

Also I was wondering if you know whether these settings are meant to be overwritten in full or whether this situation can exist:
inventory.Settings: { setting1: "something"}
server sends: Settings: { setting2: "something2", setting3: "something3"}

because in that case the old settings would get lost. Just wanna make sure we checked for that

Also I was wondering if you know whether these settings are meant to be overwritten in full or whether this situation can exist: inventory.Settings: { setting1: "something"} server sends: Settings: { setting2: "something2", setting3: "something3"} because in that case the old settings would get lost. Just wanna make sure we checked for that
Author
Contributor

I just forgot to edit the name when i copyt the file.

I was thinking that too but i havet found anything eles to trigger that endpoint

I just forgot to edit the name when i copyt the file. I was thinking that too but i havet found anything eles to trigger that endpoint
Owner

I just forgot to edit the name when i copyt the file.

I was thinking that too but i havet found anything eles to trigger that endpoint

Okey, right.
You could just use Object.Assign(old, new). This way old settings will be overwritten and new added.

> I just forgot to edit the name when i copyt the file. > > > I was thinking that too but i havet found anything eles to trigger that endpoint Okey, right. You could just use Object.Assign(old, new). This way old settings will be overwritten and new added.
Author
Contributor

It wil use Object.Assign now :)

It wil use Object.Assign now :)
CyberVenom added 1 commit 2025-02-19 13:11:20 -08:00
fix: better naming
All checks were successful
Build / build (20) (pull_request) Successful in 35s
Build / build (18) (pull_request) Successful in 1m3s
Build / build (22) (pull_request) Successful in 57s
2d97dee80c
CyberVenom added 1 commit 2025-02-19 13:11:45 -08:00
merge upstream
All checks were successful
Build / build (18) (pull_request) Successful in 37s
Build / build (20) (pull_request) Successful in 1m3s
Build / build (22) (pull_request) Successful in 57s
c9eae22312
CyberVenom added 2 commits 2025-02-19 14:04:30 -08:00
Merge remote-tracking branch 'origin/main'
All checks were successful
Build / build (20) (pull_request) Successful in 34s
Build / build (18) (pull_request) Successful in 59s
Build / build (22) (pull_request) Successful in 1m10s
b72d334eab
OrdisPrime merged commit b551563681 into main 2025-02-19 14:09:02 -08:00
Sign in to join this conversation.
No description provided.