Skip to content

Commit

Permalink
code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
anissa-agahchen committed Apr 19, 2022
1 parent 19f9a2c commit c6c0e35
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions api/src/queries/users/user-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const deactivateSystemUserSQL = (userId: number): SQLStatement | null =>
return null;
}

const sqlStatement = SQL`
return SQL`
UPDATE
system_user
SET
Expand All @@ -157,8 +157,6 @@ export const deactivateSystemUserSQL = (userId: number): SQLStatement | null =>
RETURNING
*;
`;

return sqlStatement;
};

/**
Expand All @@ -172,7 +170,7 @@ export const activateSystemUserSQL = (userId: number): SQLStatement | null => {
return null;
}

const sqlStatement = SQL`
return SQL`
UPDATE
system_user
SET
Expand All @@ -182,8 +180,6 @@ export const activateSystemUserSQL = (userId: number): SQLStatement | null => {
RETURNING
*;
`;

return sqlStatement;
};

/**
Expand All @@ -198,16 +194,14 @@ export const deleteAllSystemRolesSQL = (userId: number): SQLStatement | null =>
return null;
}

const sqlStatement = SQL`
return SQL`
DELETE FROM
system_user_role
WHERE
system_user_id = ${userId}
RETURNING
*;
`;

return sqlStatement;
};

/**
Expand All @@ -222,14 +216,12 @@ export const deleteAllProjectRolesSQL = (userId: number): SQLStatement | null =>
return null;
}

const sqlStatement = SQL`
return SQL`
DELETE FROM
project_participation
WHERE
system_user_id = ${userId}
RETURNING
*;
`;

return sqlStatement;
};

0 comments on commit c6c0e35

Please sign in to comment.