Skip to content

Commit 7e1971e

Browse files
committed
format date in audit metadata
1 parent 4a98119 commit 7e1971e

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

server/app/events.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func (a *App) logK8sDelete(userID string, role role, k8sID int, createdAt time.T
296296
Role: string(role),
297297
Timestamp: time.Now(),
298298
Metadata: fmt.Sprintf(
299-
"Kubernetes %v which created at %v, is deleted", k8sID, createdAt,
299+
"Kubernetes %v which created at %v, is deleted", k8sID, createdAt.Format("January 2, 2006"),
300300
),
301301
}
302302

@@ -315,7 +315,7 @@ func (a *App) logVMDelete(userID string, role role, vmID int, createdAt time.Tim
315315
Timestamp: time.Now(),
316316
Metadata: fmt.Sprintf(
317317
"Virtual machine %v which created at %v, is deleted",
318-
vmID, createdAt,
318+
vmID, createdAt.Format("January 2, 2006"),
319319
),
320320
}
321321

@@ -334,7 +334,7 @@ func (a *App) logInvoiceCreate(userID, currency string, invoiceID int, invoiceTo
334334
Timestamp: time.Now(),
335335
Metadata: fmt.Sprintf(
336336
"Invoice %v with value: %v %v is created at %v",
337-
invoiceID, invoiceTotal, currency, createdAt,
337+
invoiceID, invoiceTotal, currency, createdAt.Format("January 2, 2006"),
338338
),
339339
}
340340

server/app/notification_handler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ func (a *App) ListNotificationsHandler(req *http.Request) (interface{}, Response
6262
// @Failure 500 {object} Response
6363
// @Router /notification/{id} [put]
6464
func (a *App) UpdateNotificationsHandler(req *http.Request) (interface{}, Response) {
65-
userID := req.Context().Value(middlewares.UserIDKey("UserID")).(string)
66-
6765
id, err := strconv.Atoi(mux.Vars(req)["id"])
6866
if err != nil {
6967
log.Error().Err(err).Send()

0 commit comments

Comments
 (0)