fix: some api bug
This commit is contained in:
@@ -4,10 +4,6 @@
|
||||
package shop
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"juwan-backend/common/utils/contextj"
|
||||
"juwan-backend/common/utils/httpj"
|
||||
"juwan-backend/common/utils/responses"
|
||||
"net/http"
|
||||
|
||||
"juwan-backend/app/shop/api/internal/logic/shop"
|
||||
@@ -26,12 +22,7 @@ func UpdateShopHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
userId, err := httpj.GetUserIdFromHeader(r.Header)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, responses.NewErrorResp(403, errors.New("forbidden: user not authenticated")))
|
||||
}
|
||||
ctx := contextj.WithUserID(r.Context(), userId)
|
||||
l := shop.NewUpdateShopLogic(ctx, svcCtx)
|
||||
l := shop.NewUpdateShopLogic(r.Context(), svcCtx)
|
||||
resp, err := l.UpdateShop(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
|
||||
Reference in New Issue
Block a user