mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-12-13 19:55:21 +00:00
Move types to api
This commit is contained in:
@@ -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 HandleEmbed(c *fiber.Ctx) error {
|
||||
c.Set("Cache-Control", "public,max-age=31557600")
|
||||
c.Set("Content-Security-Policy", "default-src 'none'; media-src 'self'; style-src 'self'; img-src 'self'; font-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"))
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"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"
|
||||
)
|
||||
@@ -28,7 +27,7 @@ func HandleUser(c *fiber.Ctx) error {
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(2)
|
||||
user, err := types.User{}, error(nil)
|
||||
user, err := api.User{}, error(nil)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
user, err = api.FetchUser(c.Params("userID"))
|
||||
@@ -37,7 +36,7 @@ func HandleUser(c *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
submissions, err := []types.Submission{}, error(nil)
|
||||
submissions, err := []api.Submission{}, error(nil)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
submissions, err = api.FetchSubmissions(c.Params("userID"), "newest", page)
|
||||
|
||||
Reference in New Issue
Block a user