feat:#16 added uuid for all modules in back-/frontend

This commit is contained in:
masterelmar
2023-10-25 16:54:48 +02:00
parent 3cd9f1fdbd
commit 5c438424a2
12 changed files with 70 additions and 205 deletions

View File

@@ -12,16 +12,10 @@ import (
"io"
"net/http"
"net/url"
"os"
)
func AddRoutes(app *pocketbase.PocketBase) {
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
e.Router.GET("/*", apis.StaticDirectoryHandler(os.DirFS("./pb_public"), false))
return nil
})
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
_, err := e.Router.AddRoute(echo.Route{
Method: http.MethodGet,
@@ -249,8 +243,13 @@ func AddRoutes(app *pocketbase.PocketBase) {
Method: http.MethodGet,
Path: "/api/feed/migrate",
Handler: func(c echo.Context) error {
ical.MigrateFeedJson(app)
return c.JSON(200, "Migrated")
err := ical.MigrateFeedJson(app)
if err != nil {
return c.JSON(500, err)
} else {
return c.JSON(200, "Migrated")
}
},
Middlewares: []echo.MiddlewareFunc{
apis.ActivityLogger(app),