Move types to api

This commit is contained in:
video-prize-ranch
2022-07-22 11:55:22 -04:00
parent da42f7cf90
commit e0efe6caca
13 changed files with 126 additions and 139 deletions

View File

@@ -4,7 +4,6 @@ import (
"strings"
"codeberg.org/video-prize-ranch/rimgo/api"
"codeberg.org/video-prize-ranch/rimgo/types"
"codeberg.org/video-prize-ranch/rimgo/utils"
"github.com/gofiber/fiber/v2"
)
@@ -14,7 +13,7 @@ func HandlePost(c *fiber.Ctx) error {
c.Set("X-Frame-Options", "DENY")
c.Set("Content-Security-Policy", "default-src 'none'; media-src 'self'; style-src 'self'; img-src 'self'; font-src 'self'; manifest-src 'self'; block-all-mixed-content")
post, err := types.Album{}, error(nil)
post, err := api.Album{}, error(nil)
switch {
case strings.HasPrefix(c.Path(), "/a"):
post, err = api.FetchAlbum(c.Params("postID"))
@@ -31,7 +30,7 @@ func HandlePost(c *fiber.Ctx) error {
return err
}
comments := []types.Comment{}
comments := []api.Comment{}
if post.SharedWithCommunity {
c.Set("Cache-Control", "public,max-age=604800")
comments, err = api.FetchComments(c.Params("postID"))