add material setting show sample

This commit is contained in:
pakintada@gmail.com 2024-01-25 13:39:49 +07:00
parent 68bf963d05
commit 5cf0a8b761
4 changed files with 107 additions and 30 deletions

View file

@ -437,8 +437,8 @@ func (d *Data) GetMaterialSetting(countryID, filename string) []models.MaterialS
result := make([]models.MaterialSetting, 0)
if countryID == "" {
copy(result, d.currentRecipe[countryID].MaterialSetting)
return result
// copy(result, d.currentRecipe[countryID].MaterialSetting)
return d.currentRecipe[countryID].MaterialSetting
}
if !strings.Contains(filename, "tmp") {

View file

@ -117,6 +117,7 @@ func (s *Server) createHandler() {
_ = userService.CreateNewUser(context.WithValue(context.Background(), "user", &models.User{Email: "system"}), "phu", "pakin.t@forth.co.th", "", permissions.SuperAdmin)
_ = userService.CreateNewUser(context.WithValue(context.Background(), "user", &models.User{Email: "system"}), "wanlop", "wanlop.r@forth.co.th", "", permissions.SuperAdmin)
_ = userService.CreateNewUser(context.WithValue(context.Background(), "user", &models.User{Email: "system"}), "dawit", "dawit.o@forth.co.th", "", permissions.SuperAdmin)
_ = userService.CreateNewUser(context.WithValue(context.Background(), "user", &models.User{Email: "system"}), "narisara", "narisara.k@tao-bin.com", "", permissions.SuperAdmin)
// Auth Router
r.Group(func(r chi.Router) {