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

@@ -16,8 +16,6 @@ import (
const expirationTime = 5 * time.Minute
func Feed(c echo.Context, app *pocketbase.PocketBase, token string) error {
layout := "2006-01-02 15:04:05 -0700 MST"
var result string
var responseWriter = c.Response().Writer
feed, err := db.FindFeedByToken(token, app)
@@ -25,11 +23,11 @@ func Feed(c echo.Context, app *pocketbase.PocketBase, token string) error {
return c.JSON(http.StatusNotFound, err)
}
created, _ := time.Parse(layout, feed.Created)
created := feed.Created
var modules []model.FeedCollection
_ = json.Unmarshal([]byte(feed.Modules), &modules)
if created.Add(time.Hour * 265).Before(time.Now()) {
if created.Time().Add(time.Hour * 265).Before(time.Now()) {
newFeed, err := createFeedForToken(app, modules)
if err != nil {
return c.JSON(http.StatusInternalServerError, err)