20 lines
408 B
JavaScript
20 lines
408 B
JavaScript
function mapRegisterRequestToRegisterInput(body) {
|
|
return {
|
|
username: (body?.username || "").trim(),
|
|
email: (body?.email || "").trim().toLowerCase(),
|
|
password: body?.password || "",
|
|
};
|
|
}
|
|
|
|
function mapRegisterResultToResponse(result) {
|
|
return {
|
|
token: result.token,
|
|
user: result.user,
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
mapRegisterRequestToRegisterInput,
|
|
mapRegisterResultToResponse,
|
|
};
|