File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
components/breathe/sources/new-leave-request-created Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,15 @@ export default {
1010 dedupe : "unique" ,
1111 props : {
1212 ...common . props ,
13- employeeId : {
13+ employeeIds : {
1414 propDefinition : [
1515 common . props . breathe ,
1616 "employeeId" ,
1717 ] ,
18+ type : "string[]" ,
19+ label : "Employee IDs" ,
20+ description : "Return leave requests for the selected employees only" ,
21+ optional : true ,
1822 } ,
1923 } ,
2024 methods : {
@@ -26,16 +30,21 @@ export default {
2630 return this . breathe . listLeaveRequests ;
2731 } ,
2832 getArgs ( lastTs ) {
29- return {
33+ const args = {
3034 params : {
31- employee_id : this . employeeId ,
3235 startDate : lastTs ,
3336 } ,
3437 } ;
38+ if ( this . employeeIds ?. length === 1 ) {
39+ args . params . employee_id = this . employeeIds [ 0 ] ;
40+ }
3541 } ,
3642 getResourceKey ( ) {
3743 return "leave_requests" ;
3844 } ,
45+ isRelevant ( leaveRequest ) {
46+ return ! this . employeeIds ?. length || this . employeeIds . includes ( leaveRequest . employee . id ) ;
47+ } ,
3948 generateMeta ( leaveRequest ) {
4049 return {
4150 id : leaveRequest . id ,
You can’t perform that action at this time.
0 commit comments