Skip to content

Commit

Permalink
Merge pull request #16 from scarlettmiss/refactor-services
Browse files Browse the repository at this point in the history
impl
  • Loading branch information
scarlettmiss authored Apr 1, 2024
2 parents 222af6e + 8146b04 commit 67a337f
Show file tree
Hide file tree
Showing 13 changed files with 731 additions and 755 deletions.
201 changes: 95 additions & 106 deletions server/api/api.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions server/api/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"github.com/scarlettmiss/petJournal/application/domain/pet"
"github.com/scarlettmiss/petJournal/application/domain/record"
"github.com/scarlettmiss/petJournal/application/domain/user"
"github.com/scarlettmiss/petJournal/utils"
"github.com/scarlettmiss/petJournal/utils/text"
"time"
)

func PetCreateRequestToPetCreateOpts(requestBody PetCreateRequest, ownerId uuid.UUID) (application.PetCreateOptions, error) {
vId := uuid.Nil
if !utils.TextIsEmpty(requestBody.VetId) {
if !text.TextIsEmpty(requestBody.VetId) {
var err error
vId, err = uuid.Parse(requestBody.VetId)
if err != nil {
Expand All @@ -39,7 +39,7 @@ func PetCreateRequestToPetCreateOpts(requestBody PetCreateRequest, ownerId uuid.

func PetUpdateRequestToPetUpdateOpts(requestBody PetUpdateRequest, pId uuid.UUID, uId uuid.UUID) (application.PetUpdateOptions, error) {
vId := uuid.Nil
if !utils.TextIsEmpty(requestBody.VetId) {
if !text.TextIsEmpty(requestBody.VetId) {
var err error
vId, err = uuid.Parse(requestBody.VetId)
if err != nil {
Expand Down
Loading

0 comments on commit 67a337f

Please sign in to comment.