Skip to content

Commit

Permalink
adding userActivityLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Clifford committed Dec 14, 2021
1 parent 2a3ed09 commit df7fb77
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion services/api/src/resources/task/task_definition_resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const addAdvancedTaskDefinition = async (
{
input
},
{ sqlClientPool, hasPermission, models }
{ sqlClientPool, hasPermission, models, userActivityLogger }
) => {

const {
Expand Down Expand Up @@ -295,6 +295,14 @@ export const addAdvancedTaskDefinition = async (
}
}

userActivityLogger(`User added advanced task definition '${name}'`, {
project: project,
event: 'api:updateTaskDefinition',
payload: {
taskDef: insertId
}
});

return await advancedTaskFunctions(sqlClientPool).advancedTaskDefinitionById(
insertId
);
Expand Down Expand Up @@ -383,6 +391,14 @@ export const updateAdvancedTaskDefinition = async (
}
}

userActivityLogger(`User updated advanced task definition '${id}'`, {
project: project,
event: 'api:updateTaskDefinition',
payload: {
taskDef: id
}
});

return await advancedTaskFunctions(sqlClientPool).advancedTaskDefinitionById(id);
} catch (error) {
throw error
Expand Down

0 comments on commit df7fb77

Please sign in to comment.