summaryrefslogtreecommitdiff
path: root/internal/typeutils
diff options
context:
space:
mode:
Diffstat (limited to 'internal/typeutils')
-rw-r--r--internal/typeutils/converter_test.go2
-rw-r--r--internal/typeutils/internaltofrontend.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/typeutils/converter_test.go b/internal/typeutils/converter_test.go
index 0676bea1b..a5fe5201b 100644
--- a/internal/typeutils/converter_test.go
+++ b/internal/typeutils/converter_test.go
@@ -20,6 +20,7 @@ package typeutils_test
import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams/vocab"
+ "github.com/superseriousbusiness/gotosocial/internal/admin"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@@ -499,6 +500,7 @@ func (suite *TypeUtilsTestSuite) SetupTest() {
suite.db = testrig.NewTestDB(&suite.state)
suite.state.DB = suite.db
+ suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
storage := testrig.NewInMemoryStorage()
suite.state.Storage = storage
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go
index a90e88a70..2af479125 100644
--- a/internal/typeutils/internaltofrontend.go
+++ b/internal/typeutils/internaltofrontend.go
@@ -2119,7 +2119,9 @@ func (c *Converter) DomainPermToAPIDomainPerm(
domainPerm.PrivateComment = d.GetPrivateComment()
domainPerm.SubscriptionID = d.GetSubscriptionID()
domainPerm.CreatedBy = d.GetCreatedByAccountID()
- domainPerm.CreatedAt = util.FormatISO8601(d.GetCreatedAt())
+ if createdAt := d.GetCreatedAt(); !createdAt.IsZero() {
+ domainPerm.CreatedAt = util.FormatISO8601(createdAt)
+ }
// If this is a draft, also add the permission type.
if _, ok := d.(*gtsmodel.DomainPermissionDraft); ok {