feat(deps): ✨ Add support for more departments
This commit is contained in:
parent
bdf2fac1ad
commit
4369ebb2a5
19 changed files with 296 additions and 169 deletions
|
|
@ -155,6 +155,7 @@ func (rr *RecipeRouter) Route(r chi.Router) {
|
|||
for k := range rr.data.AllRecipeFiles {
|
||||
countryName, err := rr.data.GetCountryNameByID(k)
|
||||
if err != nil {
|
||||
rr.taoLogger.Log.Error("RecipeRouter.Countries", zap.Any(countryName, err))
|
||||
continue
|
||||
}
|
||||
keys = append(keys, countryName)
|
||||
|
|
@ -854,7 +855,7 @@ func (rr *RecipeRouter) getImageOfProductCode(w http.ResponseWriter, r *http.Req
|
|||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
}
|
||||
|
||||
rr.taoLogger.Log.Debug("GetImageFromFast", zap.Int("Code", resp.StatusCode));
|
||||
rr.taoLogger.Log.Debug("GetImageFromFast", zap.Int("Code", resp.StatusCode))
|
||||
|
||||
img_data, err := png.Decode(resp.Body)
|
||||
if err != nil {
|
||||
|
|
@ -864,7 +865,6 @@ func (rr *RecipeRouter) getImageOfProductCode(w http.ResponseWriter, r *http.Req
|
|||
|
||||
imgResult = img_data
|
||||
|
||||
|
||||
// write image
|
||||
png.Encode(w, imgResult)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ func (ur *UserRouter) Route(r chi.Router) {
|
|||
superPerm = superPerm | p.CountryPermission
|
||||
}
|
||||
|
||||
if superPerm < 3999 {
|
||||
superPerm = superPerm | permissions.Editor | permissions.Viewer
|
||||
}
|
||||
|
||||
// Users
|
||||
r.Route("/users", func(r chi.Router) {
|
||||
r.Get("/", middlewares.ValidatePermissions([]permissions.Permission{permissions.Permission(superPerm)}, ur.getUsers))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue