Change export convention for helper functions

This commit is contained in:
Tuan Dang
2023-06-05 21:00:23 +01:00
parent 0c18bd71c4
commit 5f5ed5d0a9
22 changed files with 133 additions and 176 deletions
+4 -6
View File
@@ -14,7 +14,7 @@ import { TOKEN_EMAIL_CONFIRMATION } from '../variables';
* @param {String} obj.email - email
* @returns {Boolean} success - whether or not operation was successful
*/
const sendEmailVerification = async ({ email }: { email: string }) => {
export const sendEmailVerification = async ({ email }: { email: string }) => {
try {
const token = await TokenService.createToken({
type: TOKEN_EMAIL_CONFIRMATION,
@@ -45,7 +45,7 @@ const sendEmailVerification = async ({ email }: { email: string }) => {
* @param {String} obj.email - emai
* @param {String} obj.code - code that was sent to [email]
*/
const checkEmailVerification = async ({
export const checkEmailVerification = async ({
email,
code
}: {
@@ -72,7 +72,7 @@ const checkEmailVerification = async ({
* @param {String} obj.organizationName - name of organization to initialize
* @param {IUser} obj.user - user who we are initializing for
*/
const initializeDefaultOrg = async ({
export const initializeDefaultOrg = async ({
organizationName,
user
}: {
@@ -96,6 +96,4 @@ const initializeDefaultOrg = async ({
} catch (err) {
throw new Error(`Failed to initialize default organization and workspace [err=${err}]`);
}
};
export { sendEmailVerification, checkEmailVerification, initializeDefaultOrg };
};