chore: remove uses of Lysand

This commit is contained in:
DevMiner 2024-08-22 23:09:58 +02:00
parent 6e59386f60
commit 9cac88861a
8 changed files with 10 additions and 10 deletions

View file

@ -38,5 +38,5 @@ func (Attachment) Edges() []ent.Edge {
}
func (Attachment) Mixin() []ent.Mixin {
return []ent.Mixin{LysandEntityMixin{}}
return []ent.Mixin{VersiaEntityMixin{}}
}

View file

@ -31,5 +31,5 @@ func (Follow) Indexes() []ent.Index {
}
func (Follow) Mixin() []ent.Mixin {
return []ent.Mixin{LysandEntityMixin{}}
return []ent.Mixin{VersiaEntityMixin{}}
}

View file

@ -67,5 +67,5 @@ func (InstanceMetadata) Edges() []ent.Edge {
}
func (InstanceMetadata) Mixin() []ent.Mixin {
return []ent.Mixin{LysandEntityMixin{}}
return []ent.Mixin{VersiaEntityMixin{}}
}

View file

@ -10,11 +10,11 @@ import (
"time"
)
type LysandEntityMixin struct{ mixin.Schema }
type VersiaEntityMixin struct{ mixin.Schema }
var _ ent.Mixin = (*LysandEntityMixin)(nil)
var _ ent.Mixin = (*VersiaEntityMixin)(nil)
func (LysandEntityMixin) Fields() []ent.Field {
func (VersiaEntityMixin) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.UUID{}).
Default(uuid.New).

View file

@ -28,5 +28,5 @@ func (Note) Edges() []ent.Edge {
}
func (Note) Mixin() []ent.Mixin {
return []ent.Mixin{LysandEntityMixin{}}
return []ent.Mixin{VersiaEntityMixin{}}
}

View file

@ -70,7 +70,7 @@ func (User) Edges() []ent.Edge {
}
}
func (User) Mixin() []ent.Mixin { return []ent.Mixin{LysandEntityMixin{}} }
func (User) Mixin() []ent.Mixin { return []ent.Mixin{VersiaEntityMixin{}} }
func ValidateUsername(username string) error {
if !usernameRegex.MatchString(username) {

View file

@ -10,7 +10,7 @@ type User struct {
Username string `json:"username"`
}
type LysandUser versia.User
type VersiaUser versia.User
type FetchUserResponse = APIResponse[User]

View file

@ -47,5 +47,5 @@ func (i *Handler) SearchUser(c *fiber.Ctx) error {
return api_schema.ErrInternalServerError(nil)
}
return c.JSON((*api_schema.LysandUser)(u.ToLysand()))
return c.JSON((*api_schema.VersiaUser)(u.ToLysand()))
}