feat/authentication
+ moved pkg/auth-helper to internal/lib/auth + update AuthInfo + cleaning
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
u "simrs-vx/internal/use-case/main-use-case/encounter"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
|
||||
d "github.com/karincake/dodol"
|
||||
)
|
||||
@@ -36,7 +36,12 @@ func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
|
||||
authInfo, err := pa.GetAuthInfo(r)
|
||||
if err != nil {
|
||||
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
|
||||
}
|
||||
dto := e.ReadListDto{}
|
||||
dto.AuthInfo = *authInfo
|
||||
sf.UrlQueryParam(&dto, *r.URL)
|
||||
res, err := u.ReadList(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
|
||||
Reference in New Issue
Block a user