don't allow going home unless profile details are complete

This commit is contained in:
counterweight 2025-02-20 23:45:13 +01:00
parent c38feef86f
commit f57a20a3a3
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
3 changed files with 26 additions and 23 deletions

View file

@ -20,7 +20,19 @@ async function setNym(publicKey, nym) {
});
}
async function areProfileDetailsComplete(publicKey) {
const isNymSet = await NymSet.findOne({ where: { public_key: publicKey } });
const areContactDetailsSet = await ContactDetailsSet.findOne({
where: {
public_key: publicKey,
},
});
return isNymSet && areContactDetailsSet;
}
module.exports = {
setContactDetails,
setNym,
areProfileDetailsComplete,
};