From 3d3fb4d855ef510f2292e98fcaaaf83debb5d3e0 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Mon, 11 Nov 2024 18:00:15 +0100 Subject: [PATCH] fix: time displayed incorrectly in audit log --- backend/internal/dto/audit_log_dto.go | 6 +++--- backend/internal/dto/user_group_dto.go | 28 ++++++++++++++------------ backend/internal/dto/webauthn_dto.go | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/backend/internal/dto/audit_log_dto.go b/backend/internal/dto/audit_log_dto.go index 1416af8..bd25954 100644 --- a/backend/internal/dto/audit_log_dto.go +++ b/backend/internal/dto/audit_log_dto.go @@ -2,12 +2,12 @@ package dto import ( "github.com/stonith404/pocket-id/backend/internal/model" - "time" + datatype "github.com/stonith404/pocket-id/backend/internal/model/types" ) type AuditLogDto struct { - ID string `json:"id"` - CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + CreatedAt datatype.DateTime `json:"createdAt"` Event model.AuditLogEvent `json:"event"` IpAddress string `json:"ipAddress"` diff --git a/backend/internal/dto/user_group_dto.go b/backend/internal/dto/user_group_dto.go index daef04b..44b51a9 100644 --- a/backend/internal/dto/user_group_dto.go +++ b/backend/internal/dto/user_group_dto.go @@ -1,23 +1,25 @@ package dto -import "time" +import ( + datatype "github.com/stonith404/pocket-id/backend/internal/model/types" +) type UserGroupDtoWithUsers struct { - ID string `json:"id"` - FriendlyName string `json:"friendlyName"` - Name string `json:"name"` - CustomClaims []CustomClaimDto `json:"customClaims"` - Users []UserDto `json:"users"` - CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + FriendlyName string `json:"friendlyName"` + Name string `json:"name"` + CustomClaims []CustomClaimDto `json:"customClaims"` + Users []UserDto `json:"users"` + CreatedAt datatype.DateTime `json:"createdAt"` } type UserGroupDtoWithUserCount struct { - ID string `json:"id"` - FriendlyName string `json:"friendlyName"` - Name string `json:"name"` - CustomClaims []CustomClaimDto `json:"customClaims"` - UserCount int64 `json:"userCount"` - CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + FriendlyName string `json:"friendlyName"` + Name string `json:"name"` + CustomClaims []CustomClaimDto `json:"customClaims"` + UserCount int64 `json:"userCount"` + CreatedAt datatype.DateTime `json:"createdAt"` } type UserGroupCreateDto struct { diff --git a/backend/internal/dto/webauthn_dto.go b/backend/internal/dto/webauthn_dto.go index ca8c869..8001f26 100644 --- a/backend/internal/dto/webauthn_dto.go +++ b/backend/internal/dto/webauthn_dto.go @@ -2,7 +2,7 @@ package dto import ( "github.com/go-webauthn/webauthn/protocol" - "time" + datatype "github.com/stonith404/pocket-id/backend/internal/model/types" ) type WebauthnCredentialDto struct { @@ -15,7 +15,7 @@ type WebauthnCredentialDto struct { BackupEligible bool `json:"backupEligible"` BackupState bool `json:"backupState"` - CreatedAt time.Time `json:"createdAt"` + CreatedAt datatype.DateTime `json:"createdAt"` } type WebauthnCredentialUpdateDto struct {