@extrahorizon/exh-cli 1.8.2-feat-79-bdd67ef → 1.8.2-feat-80-7fb183f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,10 +39,6 @@ async function syncFunctionUser(sdk, data) {
|
|
|
39
39
|
let user = await userRepository.findUserByEmail(sdk, email);
|
|
40
40
|
if (!user) {
|
|
41
41
|
console.log(chalk.white('⚙️ Creating a user for the task'));
|
|
42
|
-
const isEmailAvailable = await userRepository.isEmailAvailable(sdk, email);
|
|
43
|
-
if (!isEmailAvailable) {
|
|
44
|
-
throw new Error('❌ The user could not be created as the email address is already in use');
|
|
45
|
-
}
|
|
46
42
|
const registerUserData = {
|
|
47
43
|
firstName: `${taskName}`,
|
|
48
44
|
lastName: 'exh.tasks',
|
|
@@ -7,7 +7,11 @@ async function find(sdk) {
|
|
|
7
7
|
}
|
|
8
8
|
exports.find = find;
|
|
9
9
|
async function findByName(sdk, name) {
|
|
10
|
-
const response = await sdk.raw.get(`/tasks/v1/functions/${name}`, { customResponseKeys: ['*'] })
|
|
10
|
+
const response = await sdk.raw.get(`/tasks/v1/functions/${name}`, { customResponseKeys: ['*'] })
|
|
11
|
+
.catch(e => e);
|
|
12
|
+
if (response.status === 404) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
11
15
|
return response.data;
|
|
12
16
|
}
|
|
13
17
|
exports.findByName = findByName;
|