Merged in feat/sw-2232-sas-api-updates (pull request #1786)

SW-2232 Adapt SAS router to API changes

* Adapt sas procedures to api changes

* Remove debug logs

* Capture performLevelUpgrade error

* More sentry logging

* Merge branch 'master' into feat/sw-2232-sas-api-updates


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-04-14 13:42:58 +00:00
parent f87ea51b11
commit 3449ccec52
12 changed files with 66 additions and 101 deletions

View File

@@ -14,32 +14,17 @@ export function SASLevelUpgradeCheck() {
const { mutate } = trpc.partner.sas.performLevelUpgrade.useMutation({
onSuccess(result) {
switch (result.tierMatchState) {
case "matched":
toast.success(
intl.formatMessage(
{
defaultMessage: "Your SAS level has upgraded you to {level}!",
},
{
level: TIER_TO_FRIEND_MAP[result.toLevel],
}
)
if (result.tierMatchState === "matched") {
toast.success(
intl.formatMessage(
{
defaultMessage: "Your SAS level has upgraded you to {level}!",
},
{
level: TIER_TO_FRIEND_MAP[result.toLevel],
}
)
break
// TODO remove the logs, but keep for now to ease testing
case "notLinked":
console.log("[sas] not linked - this should never happen")
break
case "error":
console.log("[sas] something went wrong")
break
case "cached":
console.log("[sas] cached")
break
case "alreadyMatched":
console.log("[sas] already matched")
break
)
}
},
onError() {