BIG MASSIVE REFACTOR OMG
Ripped out literally everything to simplify the backend as much as possible. Some of the code was so horrifically complicated it's insaneeee
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const (
|
||||
LISTS_LIMIT = 10
|
||||
IMAGE_LIMIT = 50
|
||||
IMAGE_LIMIT = 10
|
||||
)
|
||||
|
||||
type LimitsManager struct {
|
||||
@@ -29,9 +29,9 @@ type listCount struct {
|
||||
}
|
||||
|
||||
func (m *LimitsManager) HasReachedStackLimit(userID uuid.UUID) (bool, error) {
|
||||
getStacks := Lists.
|
||||
SELECT(COUNT(Lists.UserID).AS("listCount.ListCount")).
|
||||
WHERE(Lists.UserID.EQ(UUID(userID)))
|
||||
getStacks := Stacks.
|
||||
SELECT(COUNT(Stacks.UserID).AS("listCount.ListCount")).
|
||||
WHERE(Stacks.UserID.EQ(UUID(userID)))
|
||||
|
||||
var count listCount
|
||||
err := getStacks.Query(m.dbPool, &count)
|
||||
@@ -44,9 +44,9 @@ type imageCount struct {
|
||||
}
|
||||
|
||||
func (m *LimitsManager) HasReachedImageLimit(userID uuid.UUID) (bool, error) {
|
||||
getStacks := UserImages.
|
||||
SELECT(COUNT(UserImages.UserID).AS("imageCount.ImageCount")).
|
||||
WHERE(UserImages.UserID.EQ(UUID(userID)))
|
||||
getStacks := Image.
|
||||
SELECT(COUNT(Image.UserID).AS("imageCount.ImageCount")).
|
||||
WHERE(Image.UserID.EQ(UUID(userID)))
|
||||
|
||||
var count imageCount
|
||||
err := getStacks.Query(m.dbPool, &count)
|
||||
|
||||
Reference in New Issue
Block a user