({ folderId, name, status, userId })
| 524 | } |
| 525 | |
| 526 | static find({ folderId, name, status, userId }) { |
| 527 | return this.query() |
| 528 | .withGraphFetched({ |
| 529 | steps: true, |
| 530 | }) |
| 531 | .where((builder) => { |
| 532 | if (name) { |
| 533 | builder.where('flows.name', 'ilike', `%${name}%`); |
| 534 | } |
| 535 | |
| 536 | if (status === 'published') { |
| 537 | builder.where('flows.active', true); |
| 538 | } else if (status === 'draft') { |
| 539 | builder.where('flows.active', false); |
| 540 | } |
| 541 | |
| 542 | if (userId) { |
| 543 | builder.where('flows.user_id', userId); |
| 544 | } |
| 545 | |
| 546 | if (folderId === 'null') { |
| 547 | builder.where((builder) => { |
| 548 | builder.whereNull('flows.folder_id'); |
| 549 | }); |
| 550 | } else if (folderId) { |
| 551 | builder.where('flows.folder_id', folderId); |
| 552 | } |
| 553 | }) |
| 554 | .orderBy('active', 'desc') |
| 555 | .orderBy('updated_at', 'desc'); |
| 556 | } |
| 557 | |
| 558 | async assignExecutionInterval() { |
| 559 | if (this.executionInterval && this.executionInterval !== 15) { |
no outgoing calls
no test coverage detected