From e4d0ee64a29e057e03332a53d394af944e24fbf3 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Wed, 27 Dec 2023 23:28:12 +0700 Subject: [PATCH] feat: add adoptby in pet service --- src/app/service/pet/pet.service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/service/pet/pet.service.go b/src/app/service/pet/pet.service.go index d71c292..f7f0748 100644 --- a/src/app/service/pet/pet.service.go +++ b/src/app/service/pet/pet.service.go @@ -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{} @@ -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, } } @@ -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 }