Refactor code for improved readability and consistency in multiple files
This commit is contained in:
@@ -101,12 +101,12 @@ type Session struct {
|
||||
}
|
||||
|
||||
type Organization struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
OwnerID uuid.UUID `json:"ownerId"`
|
||||
Name string `json:"name"`
|
||||
Slug string `json:"slug"`
|
||||
InviteLinkToken *string `json:"inviteLinkToken,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
OwnerID uuid.UUID `json:"ownerId"`
|
||||
Name string `json:"name"`
|
||||
Slug string `json:"slug"`
|
||||
InviteLinkToken *string `json:"inviteLinkToken,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type Membership struct {
|
||||
@@ -128,12 +128,12 @@ type Invitation struct {
|
||||
}
|
||||
|
||||
type JoinRequest struct {
|
||||
ID uuid.UUID
|
||||
OrgID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
InviteToken *string
|
||||
RequestedAt time.Time
|
||||
Status string
|
||||
ID uuid.UUID
|
||||
OrgID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
InviteToken *string
|
||||
RequestedAt time.Time
|
||||
Status string
|
||||
}
|
||||
|
||||
type Activity struct {
|
||||
|
||||
@@ -930,10 +930,10 @@ func removeMemberHandler(w http.ResponseWriter, r *http.Request, db *database.DB
|
||||
|
||||
resource := userID.String()
|
||||
auditLogger.Log(r.Context(), audit.Entry{
|
||||
OrgID: &orgID,
|
||||
Action: "remove_member",
|
||||
OrgID: &orgID,
|
||||
Action: "remove_member",
|
||||
Resource: &resource,
|
||||
Success: true,
|
||||
Success: true,
|
||||
})
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
@@ -993,11 +993,11 @@ func createInvitationHandler(w http.ResponseWriter, r *http.Request, db *databas
|
||||
}
|
||||
|
||||
auditLogger.Log(r.Context(), audit.Entry{
|
||||
UserID: &invitedBy,
|
||||
OrgID: &orgID,
|
||||
Action: "create_invitation",
|
||||
UserID: &invitedBy,
|
||||
OrgID: &orgID,
|
||||
Action: "create_invitation",
|
||||
Resource: &req.Username,
|
||||
Success: true,
|
||||
Success: true,
|
||||
})
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
@@ -1035,10 +1035,10 @@ func cancelInvitationHandler(w http.ResponseWriter, r *http.Request, db *databas
|
||||
|
||||
resource := invitationID.String()
|
||||
auditLogger.Log(r.Context(), audit.Entry{
|
||||
OrgID: &orgID,
|
||||
Action: "cancel_invitation",
|
||||
OrgID: &orgID,
|
||||
Action: "cancel_invitation",
|
||||
Resource: &resource,
|
||||
Success: true,
|
||||
Success: true,
|
||||
})
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
@@ -1142,10 +1142,10 @@ func acceptJoinRequestHandler(w http.ResponseWriter, r *http.Request, db *databa
|
||||
|
||||
resource := requestID.String()
|
||||
auditLogger.Log(r.Context(), audit.Entry{
|
||||
OrgID: &orgID,
|
||||
Action: "accept_join_request",
|
||||
OrgID: &orgID,
|
||||
Action: "accept_join_request",
|
||||
Resource: &resource,
|
||||
Success: true,
|
||||
Success: true,
|
||||
})
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
@@ -1169,10 +1169,10 @@ func rejectJoinRequestHandler(w http.ResponseWriter, r *http.Request, db *databa
|
||||
|
||||
resource := requestID.String()
|
||||
auditLogger.Log(r.Context(), audit.Entry{
|
||||
OrgID: &orgID,
|
||||
Action: "reject_join_request",
|
||||
OrgID: &orgID,
|
||||
Action: "reject_join_request",
|
||||
Resource: &resource,
|
||||
Success: true,
|
||||
Success: true,
|
||||
})
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user