@@ -458,6 +458,13 @@ func (g GroupRepo) AddMemberToGroup(ctx context.Context, orgID uuid.UUID, groupI
458458 return fmt .Errorf ("failed to add user to group: %w" , err )
459459 }
460460
461+ // Update the group's updated_at timestamp
462+ if _ , err := tx .Group .UpdateOneID (groupID ).
463+ SetUpdatedAt (time .Now ()).
464+ Save (ctx ); err != nil {
465+ return fmt .Errorf ("failed to update group timestamp: %w" , err )
466+ }
467+
461468 // Update the user membership with the role of maintainer
462469 if maintainer {
463470 _ , err = tx .Membership .Create ().
@@ -513,6 +520,13 @@ func (g GroupRepo) RemoveMemberFromGroup(ctx context.Context, orgID uuid.UUID, g
513520 return fmt .Errorf ("failed to remove user from group: %w" , err )
514521 }
515522
523+ // Update the group's updated_at timestamp
524+ if _ , err := tx .Group .UpdateOneID (groupID ).
525+ SetUpdatedAt (now ).
526+ Save (ctx ); err != nil {
527+ return fmt .Errorf ("failed to update group timestamp: %w" , err )
528+ }
529+
516530 if existingMembership .Maintainer {
517531 // Also remove the user membership if it exists
518532 if _ , err := tx .Membership .Delete ().Where (
@@ -569,14 +583,22 @@ func (g GroupRepo) UpdateMemberMaintainerStatus(ctx context.Context, orgID uuid.
569583 }
570584
571585 // Update the group membership with the new maintainer status
586+ now := time .Now ()
572587 _ , err = tx .GroupMembership .UpdateOne (existingMembership ).
573588 SetMaintainer (isMaintainer ).
574- SetUpdatedAt (time . Now () ).
589+ SetUpdatedAt (now ).
575590 Save (ctx )
576591 if err != nil {
577592 return fmt .Errorf ("failed to update group membership maintainer status: %w" , err )
578593 }
579594
595+ // Update the group's updated_at timestamp
596+ if _ , err := tx .Group .UpdateOneID (groupID ).
597+ SetUpdatedAt (now ).
598+ Save (ctx ); err != nil {
599+ return fmt .Errorf ("failed to update group timestamp: %w" , err )
600+ }
601+
580602 // Update the membership table as well
581603 if isMaintainer {
582604 // If becoming a maintainer, create the membership record if it doesn't exist
0 commit comments