This commit is contained in:
teddy
2025-04-18 18:21:38 +07:00
parent d20ff0b41b
commit 0897da39a1
2 changed files with 7 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ func GenerateSessionID() string {
func ParseHTML(filePath string, v any) string {
tmpl, err := template.ParseFiles(filePath)
if err != nil {
log.Fatalf("Error parsing template: %v", err)
log.Printf("Error parsing template: %v", err)
}
// type Data struct {
@@ -28,7 +28,7 @@ func ParseHTML(filePath string, v any) string {
var buf bytes.Buffer
if err := tmpl.Execute(&buf, v); err != nil {
log.Fatalf("Error executing template: %v", err)
log.Printf("Error executing template: %v", err)
}
return buf.String()

View File

@@ -28,7 +28,7 @@ func Route(db *gorm.DB) {
err := query.GetBirthday(db, data, fmt.Sprint(month), fmt.Sprint(day))
if err != nil {
log.Fatalf("%+v %+v response %+v", sessionID, module, err.Error())
log.Printf("%+v %+v response %+v", sessionID, module, err.Error())
w.WriteHeader(500)
w.Write([]byte(err.Error()))
}
@@ -54,7 +54,7 @@ func Route(db *gorm.DB) {
w.WriteHeader(500)
w.Write([]byte(err.Error()))
} else {
log.Fatalf("%+v %+v EMAIL SENT TO %+v", sessionID, module, v.Email)
log.Printf("%+v %+v EMAIL SENT TO %+v", sessionID, module, v.Email)
}
}(v)
}
@@ -75,7 +75,7 @@ func Route(db *gorm.DB) {
err := query.GetWorkanniversary(db, data, fmt.Sprint(month), fmt.Sprint(day))
if err != nil {
log.Fatalf("%+v %+v response %+v", sessionID, module, err.Error())
log.Printf("%+v %+v response %+v", sessionID, module, err.Error())
w.WriteHeader(500)
w.Write([]byte(err.Error()))
}
@@ -93,6 +93,7 @@ func Route(db *gorm.DB) {
}
duration := helper.FormatSince(v.HireDate)
// duration := time.Since(v.HireDate).String()
fmt.Println("durasi", duration)
@@ -108,7 +109,7 @@ func Route(db *gorm.DB) {
w.WriteHeader(500)
w.Write([]byte(err.Error()))
} else {
log.Fatalf("%+v %+v EMAIL SENT TO %+v", sessionID, module, v.Email)
log.Printf("%+v %+v EMAIL SENT TO %+v", sessionID, module, v.Email)
}
}(v)
}