mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-14 06:49:15 +00:00
feat: user profiles (#32)
* add user profiles and theme selectors * lowercase buttons by default * basic layout * (wip) init token APIs * refactor server to support variable options * fix types * api refactor / registration tests * implement UI for url and join * remove console.logs * rename repository factory * fix upload size
This commit is contained in:
parent
1ca430af21
commit
79f7ad40cb
76 changed files with 5154 additions and 388 deletions
|
@ -54,5 +54,9 @@ func (Group) Edges() []ent.Edge {
|
|||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
edge.To("invitation_tokens", GroupInvitationToken.Type).
|
||||
Annotations(entsql.Annotation{
|
||||
OnDelete: entsql.Cascade,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
42
backend/ent/schema/group_invitation_token.go
Normal file
42
backend/ent/schema/group_invitation_token.go
Normal file
|
@ -0,0 +1,42 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/hay-kot/homebox/backend/ent/schema/mixins"
|
||||
)
|
||||
|
||||
// GroupInvitationToken holds the schema definition for the GroupInvitationToken entity.
|
||||
type GroupInvitationToken struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (GroupInvitationToken) Mixin() []ent.Mixin {
|
||||
return []ent.Mixin{
|
||||
mixins.BaseMixin{},
|
||||
}
|
||||
}
|
||||
|
||||
// Fields of the GroupInvitationToken.
|
||||
func (GroupInvitationToken) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Bytes("token").
|
||||
Unique(),
|
||||
field.Time("expires_at").
|
||||
Default(func() time.Time { return time.Now().Add(time.Hour * 24 * 7) }),
|
||||
field.Int("uses").
|
||||
Default(0),
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the GroupInvitationToken.
|
||||
func (GroupInvitationToken) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("group", Group.Type).
|
||||
Ref("invitation_tokens").
|
||||
Unique(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue