email improvements

This commit is contained in:
Hayden 2024-03-02 12:02:41 -06:00
parent 6fd8457e5a
commit 29e30bfaba
No known key found for this signature in database
GPG key ID: 17CF79474E257545
47 changed files with 3710 additions and 95 deletions

View file

@ -9,6 +9,18 @@ import (
"github.com/hay-kot/homebox/backend/internal/data/ent"
)
// The ActionTokenFunc type is an adapter to allow the use of ordinary
// function as ActionToken mutator.
type ActionTokenFunc func(context.Context, *ent.ActionTokenMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f ActionTokenFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.ActionTokenMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ActionTokenMutation", m)
}
// The AttachmentFunc type is an adapter to allow the use of ordinary
// function as Attachment mutator.
type AttachmentFunc func(context.Context, *ent.AttachmentMutation) (ent.Value, error)