Merged in fix/SW-3526-show-sas-eb-points-unlinked- (pull request #2987)
fix(SW-3256): Fixed Users with 0 points throws error Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -40,11 +40,11 @@ export const enterDetails = safeProtectedServiceProcedure
|
||||
if (ctx.session?.token.access_token) {
|
||||
const pointsValue = await getUserPointsBalance(ctx.session)
|
||||
const token = getRedemptionTokenSafely(ctx.session, ctx.serviceToken)
|
||||
if (pointsValue && token) {
|
||||
if (pointsValue !== undefined && token) {
|
||||
return next({
|
||||
ctx: {
|
||||
token: token,
|
||||
userPoints: pointsValue ?? 0,
|
||||
userPoints: pointsValue,
|
||||
},
|
||||
input,
|
||||
})
|
||||
|
||||
@@ -71,11 +71,11 @@ export const hotelsByCity = safeProtectedServiceProcedure
|
||||
if (ctx.session?.token.access_token) {
|
||||
const pointsValue = await getUserPointsBalance(ctx.session)
|
||||
const token = getRedemptionTokenSafely(ctx.session, ctx.serviceToken)
|
||||
if (pointsValue && token) {
|
||||
if (pointsValue !== undefined && token) {
|
||||
return next({
|
||||
ctx: {
|
||||
token: token,
|
||||
userPoints: pointsValue ?? 0,
|
||||
userPoints: pointsValue,
|
||||
},
|
||||
input,
|
||||
})
|
||||
|
||||
@@ -68,11 +68,11 @@ export const hotelsByHotelIds = safeProtectedServiceProcedure
|
||||
if (ctx.session?.token.access_token) {
|
||||
const pointsValue = await getUserPointsBalance(ctx.session)
|
||||
const token = getRedemptionTokenSafely(ctx.session, ctx.serviceToken)
|
||||
if (pointsValue && token) {
|
||||
if (pointsValue !== undefined && token) {
|
||||
return next({
|
||||
ctx: {
|
||||
token: token,
|
||||
userPoints: pointsValue ?? 0,
|
||||
userPoints: pointsValue,
|
||||
},
|
||||
input,
|
||||
})
|
||||
|
||||
@@ -27,11 +27,11 @@ export const myStay = safeProtectedServiceProcedure
|
||||
if (ctx.session?.token.access_token) {
|
||||
const pointsValue = await getUserPointsBalance(ctx.session)
|
||||
const token = getRedemptionTokenSafely(ctx.session, ctx.serviceToken)
|
||||
if (pointsValue && token) {
|
||||
if (pointsValue !== undefined && token) {
|
||||
return next({
|
||||
ctx: {
|
||||
token: token,
|
||||
userPoints: pointsValue ?? 0,
|
||||
userPoints: pointsValue,
|
||||
},
|
||||
input,
|
||||
})
|
||||
|
||||
@@ -25,11 +25,11 @@ export const room = safeProtectedServiceProcedure
|
||||
if (ctx.session?.token.access_token) {
|
||||
const pointsValue = await getUserPointsBalance(ctx.session)
|
||||
const token = getRedemptionTokenSafely(ctx.session, ctx.serviceToken)
|
||||
if (pointsValue && token) {
|
||||
if (pointsValue !== undefined && token) {
|
||||
return next({
|
||||
ctx: {
|
||||
token: token,
|
||||
userPoints: pointsValue ?? 0,
|
||||
userPoints: pointsValue,
|
||||
},
|
||||
input,
|
||||
})
|
||||
|
||||
@@ -16,11 +16,11 @@ export const rooms = safeProtectedServiceProcedure
|
||||
if (ctx.session?.token.access_token) {
|
||||
const pointsValue = await getUserPointsBalance(ctx.session)
|
||||
const token = getRedemptionTokenSafely(ctx.session, ctx.serviceToken)
|
||||
if (pointsValue && token) {
|
||||
if (pointsValue !== undefined && token) {
|
||||
return next({
|
||||
ctx: {
|
||||
token: token,
|
||||
userPoints: pointsValue ?? 0,
|
||||
userPoints: pointsValue,
|
||||
},
|
||||
input,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user