From 47262adcacb61aafd34b3f85c9d4f4f3bb7bb540 Mon Sep 17 00:00:00 2001 From: PickHD Date: Mon, 3 Jul 2023 07:37:07 +0700 Subject: [PATCH] fix (SRI-03) : set absolute path url on response instead saving on db --- user/internal/v1/service/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user/internal/v1/service/user.go b/user/internal/v1/service/user.go index 3dc5e70..6677558 100644 --- a/user/internal/v1/service/user.go +++ b/user/internal/v1/service/user.go @@ -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) @@ -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 }