Incluindo exibição de informações de contato no perfil

This commit is contained in:
Matheus Albino Brunhara
2022-06-07 19:20:18 -05:00
parent 4fda0c9fba
commit fb9b5f4d00
7 changed files with 184 additions and 11 deletions

View File

@@ -50,4 +50,40 @@ const getById = async (userId: string): Promise<getByIdReturn> => {
}
};
export default { getById }
interface getByIdReturn {
data?: {
phone: '',
whatsapp: '',
facebook: '',
telegram: '',
},
error?: {
errorMessage: string;
}
}
const getUserSocialInfo = async (userId: string): Promise<getByIdReturn> => {
try {
let res: getByIdRes = await usersRoutes.getSocialInfo(userId)
if (res.status === "error") {
return {
error: {
errorMessage: res.message,
}
};
}
return {
userData: res.data,
};
} catch(err) {
return {
error: {
errorMessage: "Por favor, autentique-se.",
}
};
}
};
export default { getById, getUserSocialInfo }