feat: Implement onlyOwnedFlows filter to get flows API endpoint

This commit is contained in:
Faruk AYDIN
2025-03-14 16:37:14 +01:00
parent 60b5d71309
commit d8d89032ae
3 changed files with 36 additions and 2 deletions

View File

@@ -531,7 +531,7 @@ class User extends Base {
return folders.map((folder) => folder.id);
}
getFlows({ folderId, name, status }, ownedFolderIds) {
getFlows({ folderId, name, status, onlyOwnedFlows }, ownedFolderIds) {
return this.authorizedFlows
.clone()
.withGraphFetched({
@@ -548,6 +548,10 @@ class User extends Base {
builder.where('flows.active', false);
}
if (onlyOwnedFlows) {
builder.where('flows.user_id', this.id);
}
if (folderId === 'null') {
builder
.whereNull('flows.folder_id')