Skip to content

Commit

Permalink
Merge pull request #131 from PROCEED-Labs/process-owner
Browse files Browse the repository at this point in the history
Process owner
  • Loading branch information
LucasMGo authored Oct 23, 2023
2 parents cb91f82 + c6b961f commit ae724da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ rolesRouter.put('/:id', validateRole, isAllowed('update', 'Role'), async (req, r
try {
// validateRole turns expiration into a Date, in order for the object merge
// to work, we need it to be a string (type safe option in mergeIntoObject)
if (typeof role.expiration === 'object') {
if (role.expiration !== null && typeof role.expiration === 'object') {
/** @type {Date} */
const expirationDate = role.expiration;
role.expiration = expirationDate.toISOString();
Expand Down
2 changes: 2 additions & 0 deletions src/management-system/src/backend/server/rest-api/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ processRouter.post('/', isAllowed('create', 'Process'), async (req, res) => {
return;
}

body.owner = req.session.userId || '';

/** @type {Ability} */
const userAbility = req.userAbility;

Expand Down

0 comments on commit ae724da

Please sign in to comment.