forked from mirrors/homebox
end-to-end testing setup
This commit is contained in:
parent
b4eb7d8ddc
commit
ad4c8c9ab4
41 changed files with 544 additions and 313 deletions
20
backend/internal/services/mappers/user.go
Normal file
20
backend/internal/services/mappers/user.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package mappers
|
||||
|
||||
import (
|
||||
"github.com/hay-kot/content/backend/ent"
|
||||
"github.com/hay-kot/content/backend/internal/types"
|
||||
)
|
||||
|
||||
func ToOutUser(user *ent.User, err error) (*types.UserOut, error) {
|
||||
if err != nil {
|
||||
return &types.UserOut{}, err
|
||||
}
|
||||
return &types.UserOut{
|
||||
ID: user.ID,
|
||||
Name: user.Name,
|
||||
Email: user.Email,
|
||||
IsSuperuser: user.IsSuperuser,
|
||||
GroupName: user.Edges.Group.Name,
|
||||
GroupID: user.Edges.Group.ID,
|
||||
}, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue