Skip to content

Commit af842b0

Browse files
committed
fix: complete the copilot requests if the incoming role is observer or customer
1 parent 1d19d15 commit af842b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/projectMembers/update.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module.exports = [
119119
let updatedProps = req.body;
120120
const projectId = _.parseInt(req.params.projectId);
121121
const memberRecordId = _.parseInt(req.params.id);
122+
const action = updatedProps.action;
122123
updatedProps = _.pick(updatedProps, ['isPrimary', 'role']);
123124
const fields = req.query.fields ? req.query.fields.split(',') : null;
124125

@@ -153,7 +154,7 @@ module.exports = [
153154
req.log.debug(`updated props ${JSON.stringify(updatedProps)}`);
154155
req.log.debug(`previous values ${JSON.stringify(previousValue)}`);
155156
// no updates if no change
156-
if ((updatedProps.role === previousValue.role || updatedProps.action === 'overwrite') &&
157+
if ((updatedProps.role === previousValue.role || action === 'overwrite') &&
157158
(_.isUndefined(updatedProps.isPrimary) ||
158159
updatedProps.isPrimary === previousValue.isPrimary)) {
159160
await completeAllCopilotRequests(req, projectId, _transaction);

0 commit comments

Comments
 (0)