return account created in user service

This commit is contained in:
Asim Aslam
2021-08-16 14:30:23 +01:00
parent b966fcbd98
commit 432b31f56e

View File

@@ -83,15 +83,22 @@ func (s *User) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.Create
if req.Id == "" { if req.Id == "" {
req.Id = uuid.New().String() req.Id = uuid.New().String()
} }
err = s.domain.Create(ctx, &pb.Account{
acc := &pb.Account{
Id: req.Id, Id: req.Id,
Username: req.Username, Username: req.Username,
Email: req.Email, Email: req.Email,
Profile: req.Profile, Profile: req.Profile,
}, salt, pp) }
err = s.domain.Create(ctx, acc, salt, pp)
if err != nil { if err != nil {
return err return err
} }
// return the account
rsp.Account = acc
return nil return nil
} }