Merged in fix/make-user-loyalty-optional (pull request #2044)
fix: Make loyalty optional on user * Optional user loyalty * merge Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
committed by
Joakim Jäderberg
parent
cbbde963dc
commit
60af31762b
@@ -103,7 +103,7 @@ export const getUserSchema = z
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
loyalty: userLoyaltySchema,
|
||||
loyalty: userLoyaltySchema.optional(),
|
||||
}),
|
||||
type: z.string(),
|
||||
}),
|
||||
@@ -111,7 +111,9 @@ export const getUserSchema = z
|
||||
.transform((apiResponse) => {
|
||||
return {
|
||||
...apiResponse.data.attributes,
|
||||
membership: getFriendsMembership(apiResponse.data.attributes.loyalty),
|
||||
membership: apiResponse.data.attributes.loyalty
|
||||
? getFriendsMembership(apiResponse.data.attributes.loyalty)
|
||||
: null,
|
||||
name: `${apiResponse.data.attributes.firstName} ${apiResponse.data.attributes.lastName}`,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user