feat: site languages, setup and site URL settings

This commit is contained in:
Florian Sylvain committed 2026-11-01 22:13:02 +01:00
1 parent 0806733d5c
commit d9158025d4
106 files changed
+10184 -56

No files matched your search

+26
View File
@@ -4,11 +4,13 @@ import (
"RenewCMS/api"
"RenewCMS/internal/domain/article"
"RenewCMS/internal/domain/site"
"RenewCMS/internal/domain/transaction"
"RenewCMS/internal/infrastructure/useCases"
"encoding/json"
"io"
"log"
"net/http/httptest"
"slices"
"sort"
"strconv"
"strings"
@@ -27,6 +29,30 @@ type mockSiteRepo struct {
deleteCalls int
deleteReassignments []*uint32
setDefaultCalls int
lockedSites []uint32
tryLocked [][]uint32
busy bool
afterTryLock func()
}
func (m *mockSiteRepo) LockSite(id uint32) error {
m.lockedSites = append(m.lockedSites, id)
if m.busy {
return transaction.ErrLockContention
}
return nil
}
func (m *mockSiteRepo) TryLockSites(ids []uint32) error {
m.tryLocked = append(m.tryLocked, slices.Clone(ids))
if m.busy {
return transaction.ErrLockContention
}
if hook := m.afterTryLock; hook != nil {
m.afterTryLock = nil
hook()
}
return nil
}
func newMockSiteRepo(articles *mockArticleRepo) *mockSiteRepo {