Skip to content

Commit

Permalink
Merge pull request #23815 from rezkiy37/fix/21456-pass-write-capability
Browse files Browse the repository at this point in the history
Fix/21456 - Polish admins-only policy room - Pass arguments properly
  • Loading branch information
amyevans authored Jul 31, 2023
2 parents eb02006 + cdd844b commit 024d210
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/ReportActionItem/MoneyRequestAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function MoneyRequestAction(props) {
false,
'',
undefined,
undefined,
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
props.action.reportActionID,
props.requestReportID,
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ function buildOptimisticChatReport(
isOwnPolicyExpenseChat = false,
oldPolicyName = '',
visibility = undefined,
writeCapability = CONST.REPORT.WRITE_CAPABILITIES.ALL,
writeCapability = undefined,
notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
parentReportActionID = '',
parentReportID = '',
Expand Down Expand Up @@ -2046,6 +2046,7 @@ function buildOptimisticWorkspaceChats(policyID, policyName) {
false,
policyName,
null,
undefined,

// #announce contains all policy members so notifying always should be opt-in only.
CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY,
Expand Down
3 changes: 2 additions & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ function navigateToAndOpenChildReport(childReportID = '0', parentReportAction =
false,
'',
undefined,
undefined,
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
parentReportAction.reportActionID,
parentReportID,
Expand Down Expand Up @@ -1270,7 +1271,7 @@ function navigateToConciergeChat() {
* @param {Array<Number>} policyMembersAccountIDs
* @param {String} writeCapability
*/
function addPolicyReport(policyID, reportName, visibility, policyMembersAccountIDs, writeCapability) {
function addPolicyReport(policyID, reportName, visibility, policyMembersAccountIDs, writeCapability = CONST.REPORT.WRITE_CAPABILITIES.ALL) {
// The participants include the current user (admin), and for restricted rooms, the policy members. Participants must not be empty.
const members = visibility === CONST.REPORT.VISIBILITY.RESTRICTED ? policyMembersAccountIDs : [];
const participants = _.unique([currentUserAccountID, ...members]);
Expand Down

0 comments on commit 024d210

Please sign in to comment.