fix(instance-metadata): add required CreatedAt field

This commit is contained in:
DevMiner 2024-08-27 19:24:36 +02:00
parent d6bdcce4f4
commit 290dadcbe7
3 changed files with 5 additions and 0 deletions

View file

@ -72,6 +72,7 @@ func NewInstanceMetadata(dbData *ent.InstanceMetadata) (*InstanceMetadata, error
func (m InstanceMetadata) ToLysand() versia.InstanceMetadata { func (m InstanceMetadata) ToLysand() versia.InstanceMetadata {
return versia.InstanceMetadata{ return versia.InstanceMetadata{
CreatedAt: versiautils.TimeFromStd(m.CreatedAt),
Extensions: m.Extensions, Extensions: m.Extensions,
Name: m.Name, Name: m.Name,
Description: m.Description, Description: m.Description,

View file

@ -56,6 +56,7 @@ func (i *InstanceMetadataRepositoryImpl) ImportFromLysandByURI(ctx context.Conte
defer s.End() defer s.End()
ctx = s.Context() ctx = s.Context()
// TODO: implement storing the instance metadata
//i.federationService. //i.federationService.
return nil, nil return nil, nil

View file

@ -15,6 +15,9 @@ type InstanceMetadata struct {
// Type is always "InstanceMetadata" // Type is always "InstanceMetadata"
Type string `json:"type"` Type string `json:"type"`
// CreatedAt is the initial date when the instance was first created
CreatedAt versiautils.Time `json:"created_at"`
// Extensions is a map of active extensions // Extensions is a map of active extensions
Extensions Extensions `json:"extensions,omitempty"` Extensions Extensions `json:"extensions,omitempty"`