File tree Expand file tree Collapse file tree
frontend/libs/portal/components/dialog/project Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 "html"
99 "net/http"
1010 "strings"
11+ "unicode"
1112
1213 "github.com/eclipse-disuko/disuko/helper/exception"
1314 "github.com/eclipse-disuko/disuko/helper/message"
@@ -24,10 +25,12 @@ type ApplicationHandler struct {
2425
2526func (handler * ApplicationHandler ) SearchHandler (w http.ResponseWriter , r * http.Request ) {
2627 requestSession := logy .GetRequestSession (r )
27- query := strings .TrimSpace (r .URL .Query ().Get ("query" ))
28- if len (query ) < 4 {
28+
29+ rawQuery := r .URL .Query ().Get ("query" )
30+ if strings .TrimSpace (rawQuery ) == "" || len (rawQuery ) < 3 {
2931 exception .ThrowExceptionClient400Message (message .GetI18N (message .RequestApp ), "" )
3032 }
33+ query := strings .TrimLeftFunc (rawQuery , unicode .IsSpace )
3134
3235 response := make ([]* project.ApplicationMetaDto , 0 )
3336 if handler .Connector == nil {
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ export default defineComponent({
120120 });
121121
122122 const search = async () => {
123- if (! searchFieldInput .value || searchFieldInput .value .length < 4 ) {
123+ if (! searchFieldInput .value || searchFieldInput .value .length < 3 ) {
124124 return ;
125125 }
126126 isLoading .value = true ;
You can’t perform that action at this time.
0 commit comments