Skip to content

Commit

Permalink
fix (SRI-03) : set absolute path url on response instead saving on db
Browse files Browse the repository at this point in the history
  • Loading branch information
PickHD committed Jul 3, 2023
1 parent e2cc53d commit 47262ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions user/internal/v1/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (us *UserServiceImpl) GenerateUserShorts(userID string, req *model.ShortUse
msg := model.GenerateShortUserMessage{
FullURL: req.FullURL,
UserID: userID,
ShortURL: fmt.Sprintf("%s/%s", us.Config.HttpService.ShortenerBaseAPIURL, helper.RandomStringBytesMaskImprSrcSB(8)),
ShortURL: helper.RandomStringBytesMaskImprSrcSB(8),
}

err := us.UserRepo.PublishCreateUserShortener(us.Context, &msg)
Expand All @@ -107,7 +107,7 @@ func (us *UserServiceImpl) GenerateUserShorts(userID string, req *model.ShortUse
}

return &model.ShortUserResponse{
ShortURL: msg.ShortURL,
ShortURL: fmt.Sprintf("%s/%s", us.Config.HttpService.ShortenerBaseAPIURL, msg.ShortURL),
Method: "GET",
}, nil
}
Expand Down

0 comments on commit 47262ad

Please sign in to comment.