bugfixes
authorPhiTux <redacted>
Tue, 9 Sep 2025 13:50:17 +0000 (15:50 +0200)
committerPhiTux <redacted>
Tue, 9 Sep 2025 13:50:17 +0000 (15:50 +0200)
backend/handlers/additional.go
backend/handlers/users.go
backend/utils/file_handling.go
frontend/src/lib/Sidenav.svelte
frontend/src/routes/login/+page.svelte

index 8c71642e2d010fabc7c550b27e5dc6e0645aef1b..9d50c12d601d3f004dffc3187fd7a3cb4288985c 100644 (file)
@@ -1342,7 +1342,7 @@ func Search(w http.ResponseWriter, r *http.Request) {
        // Traverse all years and months
        yearEntries, err := os.ReadDir(userDir)
        if err != nil {
-               http.Error(w, fmt.Sprintf("Error reading user directory: %v", err), http.StatusInternalServerError)
+               http.Error(w, "No logs found to be searched", http.StatusNotFound)
                return
        }
 
index 09bf0fcc57365c0f5438259a5a0e060174573871..47b85bbd45bb20f3c584a88ac063f43d46d9f043 100644 (file)
@@ -279,7 +279,7 @@ func Register(username string, password string) (bool, error) {
 
                        if username_from_file, ok := user["username"].(string); ok && strings.EqualFold(username_from_file, username) {
                                utils.Logger.Printf("Registration failed. Username '%s' already exists", username)
-                               return false, fmt.Errorf("username already exists: %d", http.StatusBadRequest)
+                               return false, fmt.Errorf("username already exists (error %d)", http.StatusBadRequest)
                        }
                }
        }
index 39dc79c81d026265160cb197b435435198d5cf62..2f26504879e7f12e9e70da0dda95b427b57ef7b8 100644 (file)
@@ -145,7 +145,6 @@ func GetTags(userID int) (map[string]any, error) {
        file, err := os.Open(filePath)
        if err != nil {
                if os.IsNotExist(err) {
-                       Logger.Printf("%s - File not found", filePath)
                        return map[string]any{}, nil
                }
                Logger.Printf("Error opening %s: %v", filePath, err)
@@ -212,7 +211,6 @@ func GetUserSettings(userID int) (string, error) {
        file, err := os.Open(filePath)
        if err != nil {
                if os.IsNotExist(err) {
-                       Logger.Printf("%s - File not found", filePath)
                        return "", nil
                }
                Logger.Printf("Error opening %s: %v", filePath, err)
index 76c17ee8ef5b8b62e986a6a6552245d0c7dc631d..2ae549bad0cc65f3c45b36d0f26597e91969b431 100644 (file)
@@ -89,7 +89,7 @@
                        })
                        .catch((error) => {
                                $searchResults = [];
-                               console.error(error);
+                               console.error(error.response.data);
                                $isSearching = false;
 
                                // toast
index a2ba50e081a6d056094bb89d358d820b41c97e6b..deffe9ebc54dadccbdd4e24e9410e01f0bfc5f06 100644 (file)
                                                        </div>
                                                        {#if !registration_allowed}
                                                                <div class="alert alert-danger" role="alert">
-                                                                       {t('login.alert.registration_not_allowed')}
+                                                                       {$t('login.alert.registration_not_allowed')}
                                                                </div>
                                                        {/if}
                                                        {#if show_registration_failed_with_message}
                                                                <div class="alert alert-danger" role="alert">
-                                                                       {@html (t('login.alert.registration_failed_with_message'),
-                                                                       {
+                                                                       {@html $t('login.alert.registration_failed_with_message', {
                                                                                message: registration_failed_message
                                                                        })}
                                                                </div>
git clone https://git.99rst.org/PROJECT