Initial commit
This commit is contained in:
20
utils/projectProfile.js
Normal file
20
utils/projectProfile.js
Normal file
@@ -0,0 +1,20 @@
|
||||
function canCreateProject(user) {
|
||||
return Boolean(
|
||||
user?.user_name?.trim() &&
|
||||
user?.first_name?.trim() &&
|
||||
user?.last_name?.trim()
|
||||
);
|
||||
}
|
||||
|
||||
function respondProjectProfileIncomplete(res) {
|
||||
return res.status(422).json({
|
||||
error: true,
|
||||
message:
|
||||
"برای ثبت پروژه، تکمیل نام کاربری، نام و نام خانوادگی در تنظیمات الزامی است",
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
canCreateProject,
|
||||
respondProjectProfileIncomplete,
|
||||
};
|
||||
Reference in New Issue
Block a user