Skip to content

SudoSOS Back-end API / users / asUserResponse

Function: asUserResponse() ​

ts
function asUserResponse(
   user, 
   timestamps?, 
   acceptedToS?): UserResponse;

Parses a User entity to a UserResponse

Parameters ​

ParameterTypeDefault valueDescription
userUserundefinedUser entity with loaded relations (especially memberUser)
timestampsbooleanfalseWhether to include createdAt and updatedAt
acceptedToS?TermsOfServiceStatusundefinedThe user's computed TOS status. When omitted, acceptedToS is left undefined; use asUserResponses to populate it for a list of users.

Returns ​

UserResponse