Skip to content

Commit

Permalink
is: Update user registry bookmarks operations
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspcr committed Mar 5, 2024
1 parent d096b1c commit 5aaf84b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/identityserver/user_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,9 @@ func (is *IdentityServer) deleteUser(ctx context.Context, ids *ttnpb.UserIdentif
if err != nil {
return err
}
if err := st.DeleteEntityBookmarks(ctx, ids.GetEntityIdentifiers()); err != nil {
return err
}
return st.DeleteUser(ctx, ids)
})
if err != nil {
Expand All @@ -733,6 +736,9 @@ func (is *IdentityServer) restoreUser(ctx context.Context, ids *ttnpb.UserIdenti
if time.Since(*deletedAt) > is.configFromContext(ctx).Delete.Restore {
return errRestoreWindowExpired.New()
}
if err := st.RestoreEntityBookmarks(ctx, ids.GetEntityIdentifiers()); err != nil {
return err
}
return st.RestoreUser(ctx, ids)
})
if err != nil {
Expand Down Expand Up @@ -764,6 +770,12 @@ func (is *IdentityServer) purgeUser(ctx context.Context, ids *ttnpb.UserIdentifi
if err != nil {
return err
}
if err := st.PurgeEntityBookmarks(ctx, ids.GetEntityIdentifiers()); err != nil {
return err
}
if err := st.PurgeUserBookmarks(ctx, ids); err != nil {
return err
}
return st.PurgeUser(ctx, ids)
})
if err != nil {
Expand Down

0 comments on commit 5aaf84b

Please sign in to comment.