Sprint #14
Merge request reports
Activity
Filter activity
132 132 133 133 if (!permission) return false 134 134 135 const collectionId = get(object, 'fragment.collectionId') 136 const { status } = await context.models.Collection.find(collectionId) 151 152 return coll 152 153 } 153 154 154 const stripeFragmentByRole = (fragment = {}, role = '', user = {}) => { 155 const stripeFragmentByRole = ( 156 fragment = {}, 157 role = '', 158 status = '', 142 144 if (!authorAllowedStatuses.includes(coll.status)) { 143 145 coll = { Big debate related to this thing and at the moment I don't know 100% sure how it works. I'd suggest just returning the new collection instead of assigning the modified object.
151 152 return coll 152 153 } 153 154 154 const stripeFragmentByRole = (fragment = {}, role = '', user = {}) => { 155 const stripeFragmentByRole = ( 156 fragment = {}, 157 role = '', 158 status = '', 159 user = {}, 160 ) => { 155 161 const { recommendations, files, authors } = fragment In my opinion, one useful thing for functions with more than two parameters is instead to define only one object parameter. Sebi talked about it at a Show&Tell session and he already applies this on the backend.
More can be found here.
1 import React, { Fragment } from 'react' 2 import { ReviewReportCard } from './' 3 4 const ReviewReportsList = ({ recommendations, showBorder }) => ( 5 <Fragment> 6 {recommendations.length ? ( 7 recommendations.map((r, index) => ( mentioned in commit 8add3f2b