feat: Add status flag to get flows filters

This commit is contained in:
Faruk AYDIN
2025-03-14 14:36:52 +01:00
parent 4bb73c9f64
commit 60b5d71309
2 changed files with 28 additions and 1 deletions

View File

@@ -531,7 +531,7 @@ class User extends Base {
return folders.map((folder) => folder.id);
}
getFlows({ folderId, name }, ownedFolderIds) {
getFlows({ folderId, name, status }, ownedFolderIds) {
return this.authorizedFlows
.clone()
.withGraphFetched({
@@ -542,6 +542,12 @@ class User extends Base {
builder.where('flows.name', 'ilike', `%${name}%`);
}
if (status === 'published') {
builder.where('flows.active', true);
} else if (status === 'draft') {
builder.where('flows.active', false);
}
if (folderId === 'null') {
builder
.whereNull('flows.folder_id')