Skip to content

Commit

Permalink
Merge pull request #70 from moevm/frontend-prototype-analysis
Browse files Browse the repository at this point in the history
createdAt for getPlantsById
  • Loading branch information
defrozentruth authored Dec 12, 2024
2 parents 39b7e8f + 16521c4 commit 02ffbff
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 40 deletions.
1 change: 1 addition & 0 deletions server/api/plants/v1/plants.proto
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ message GetPlantByIdV1Response{
string place = 9;
string image = 10;
float price = 11;
google.protobuf.Timestamp createdAt = 12;
}
message User {
string id = 1;
Expand Down
2 changes: 2 additions & 0 deletions server/internal/handlers/plants/get_plant_by_id_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"

api "plants/internal/pkg/pb/plants/v1"
)
Expand Down Expand Up @@ -34,6 +35,7 @@ func (h *Handler) GetPlantByIdV1(
Description: plant.Description,
Place: plant.Place,
Image: plant.Image,
CreatedAt: timestamppb.New(plant.CreatedAt),
},
User: &api.GetPlantByIdV1Response_User{
Id: user.ID.Hex(),
Expand Down
Loading

0 comments on commit 02ffbff

Please sign in to comment.