diff --git a/pkg/handler/payroll/commit.go b/pkg/handler/payroll/commit.go index 0c7a3dd1c..068e9fa6a 100644 --- a/pkg/handler/payroll/commit.go +++ b/pkg/handler/payroll/commit.go @@ -66,17 +66,17 @@ func (h *handler) CommitPayroll(c *gin.Context) { return } - //err = h.controller.Discord.Log(model.LogDiscordInput{ - // Type: "payroll_commit", - // Data: map[string]interface{}{ - // "batch_number": strconv.Itoa(int(batch)), - // "month": time.Month(month).String(), - // "year": year, - // }, - //}) - //if err != nil { - // l.Error(err, "failed to logs to discord") - //} + err = h.controller.Discord.Log(model.LogDiscordInput{ + Type: "payroll_commit", + Data: map[string]interface{}{ + "batch_number": strconv.Itoa(int(batch)), + "month": time.Month(month).String(), + "year": year, + }, + }) + if err != nil { + l.Error(err, "failed to logs to discord") + } c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, nil, nil, "")) } diff --git a/pkg/service/service.go b/pkg/service/service.go index de80fab3a..ad8687e06 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -68,6 +68,13 @@ func New(cfg *config.Config, store *store.Store, repo store.DBRepo) *Service { Scopes: []string{"email", "profile"}, } + googleAuthSvc, err := googleauth.New( + authServiceCfg, + ) + if err != nil { + logger.L.Error(err, "failed to init google auth") + } + gcsSvc, err := googlestorage.New( cfg.Google.GCSBucketName, cfg.Google.GCSProjectID, @@ -77,13 +84,6 @@ func New(cfg *config.Config, store *store.Store, repo store.DBRepo) *Service { logger.L.Error(err, "failed to init gcs") } - googleAuthSvc, err := googleauth.New( - authServiceCfg, - ) - if err != nil { - logger.L.Error(err, "failed to init google auth") - } - driveConfig := &oauth2.Config{ ClientID: cfg.Google.ClientID, ClientSecret: cfg.Google.ClientSecret,