diff --git a/approve.png b/approve.png new file mode 100644 index 0000000..c800e66 Binary files /dev/null and b/approve.png differ diff --git a/main.go b/main.go index 82817f3..c0a9f4d 100755 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "net/http" "net/mail" "os" - + "path/filepath" "pocketbase/utils" "strings" "time" @@ -587,6 +587,32 @@ func main() { app.OnBeforeServe().Add(func(e *core.ServeEvent) error { + e.Router.GET("/api/getImagePath", func(c echo.Context) error { + + fileName := c.QueryParam("file") + if fileName == "" { + return c.JSON(http.StatusBadRequest, map[string]string{ + "error": "missing file parameter", + }) + } + + // Static files folder + staticPath := "./pb_public" + fullPath := filepath.Join(staticPath, fileName) + + // Check if file exists + if _, err := os.Stat(fullPath); os.IsNotExist(err) { + return c.JSON(http.StatusNotFound, map[string]string{ + "error": "file not found", + }) + } + + // Serve the file directly (browser will show the image) + return c.File(fullPath) + }) + + // e.Router.Static("/static", "./pb_public") + e.Router.GET("/pw/auth/confirm-password-reset/:token", func(c echo.Context) error { return c.File("pb_public/confirm_password_reset.html") }) diff --git a/pb_data/data.db-shm b/pb_data/data.db-shm new file mode 100755 index 0000000..fe9ac28 Binary files /dev/null and b/pb_data/data.db-shm differ diff --git a/pb_data/data.db-wal b/pb_data/data.db-wal new file mode 100755 index 0000000..e69de29 diff --git a/pb_data/logs.db-shm b/pb_data/logs.db-shm new file mode 100644 index 0000000..0a77177 Binary files /dev/null and b/pb_data/logs.db-shm differ diff --git a/pb_data/logs.db-wal b/pb_data/logs.db-wal new file mode 100644 index 0000000..f564f68 Binary files /dev/null and b/pb_data/logs.db-wal differ diff --git a/pb_public/approve.png b/pb_public/approve.png new file mode 100644 index 0000000..c800e66 Binary files /dev/null and b/pb_public/approve.png differ diff --git a/pb_public/reject.png b/pb_public/reject.png new file mode 100644 index 0000000..c5165e6 Binary files /dev/null and b/pb_public/reject.png differ diff --git a/reject.png b/reject.png new file mode 100644 index 0000000..c5165e6 Binary files /dev/null and b/reject.png differ