File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/model Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,20 @@ public boolean agencyProfile() {
128
128
}
129
129
130
130
public Mono <ApplicationQuery > getQueryByViewModeAndQueryId (boolean isViewMode , String queryId , ApplicationRecordService applicationRecordService ) {
131
- return getLiveQueries (applicationRecordService ).map (liveQueries -> (isViewMode ? liveQueries : getEditingQueries ())
132
- .stream ()
133
- .filter (query -> queryId .equals (query .getId ()) || queryId .equals (query .getGid ()))
134
- .findFirst ()
135
- .orElseThrow (() -> new BizException (BizError .QUERY_NOT_FOUND , "LIBRARY_QUERY_NOT_FOUND" )));
131
+ return isViewMode ?
132
+ // Get Published Queries in View/View Marketplace Mode
133
+ getLiveQueries (applicationRecordService ).map (liveQueries -> (liveQueries )
134
+ .stream ()
135
+ .filter (query -> queryId .equals (query .getId ()) || queryId .equals (query .getGid ()))
136
+ .findFirst ()
137
+ .orElseThrow (() -> new BizException (BizError .QUERY_NOT_FOUND , "LIBRARY_QUERY_NOT_FOUND" )))
138
+ :
139
+ // Get Editing Queries in Edit/Preview Mode
140
+ Mono .just (getEditingQueries ()
141
+ .stream ()
142
+ .filter (query -> queryId .equals (query .getId ()) || queryId .equals (query .getGid ()))
143
+ .findFirst ()
144
+ .orElseThrow (() -> new BizException (BizError .QUERY_NOT_FOUND , "LIBRARY_QUERY_NOT_FOUND" )));
136
145
}
137
146
138
147
/**
You can’t perform that action at this time.
0 commit comments