Skip to content

Commit

Permalink
feat: add adoptby in pet service
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Dec 27, 2023
1 parent c0d0177 commit e4d0ee6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/service/pet/pet.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (s Service) FindOne(_ context.Context, req *proto.FindOnePetRequest) (res *
func (s *Service) Create(_ context.Context, req *proto.CreatePetRequest) (res *proto.CreatePetResponse, err error) {
raw, err := DtoToRaw(req.Pet)
if err != nil {
return nil, status.Error(codes.Internal, "error converting dto to raw")
return nil, status.Error(codes.Internal, "error converting dto to raw: "+err.Error())
}

imgUrls := []string{}
Expand Down Expand Up @@ -183,6 +183,7 @@ func RawToDto(in *pet.Pet, imgUrl []string) *proto.Pet {
Background: in.Background,
Address: in.Address,
Contact: in.Contact,
AdoptBy: in.AdoptBy,
}
}

Expand Down Expand Up @@ -234,6 +235,7 @@ func DtoToRaw(in *proto.Pet) (res *pet.Pet, err error) {
Background: in.Background,
Address: in.Address,
Contact: in.Contact,
AdoptBy: in.AdoptBy,
}, nil
}

Expand Down

0 comments on commit e4d0ee6

Please sign in to comment.