diff --git a/pkg/db/business_impl.go b/pkg/db/business_impl.go index d4decbe0..742f5b05 100644 --- a/pkg/db/business_impl.go +++ b/pkg/db/business_impl.go @@ -1241,20 +1241,6 @@ func (impl *BusinessStoreImpl) GetCachedOrgInviteByID(ctx context.Context, invit return FetchCachedOne[dbgen.OrganizationUser](ctx, impl.cache, orgInviteCacheKey(inviteID)) } -func (impl *BusinessStoreImpl) RetrieveOrgInviteByID(ctx context.Context, inviteID int32) (*dbgen.OrganizationUser, error) { - reader := &StoreOneReader[int32, dbgen.OrganizationUser]{ - CacheKey: orgInviteCacheKey(inviteID), - Cache: impl.cache, - } - - if impl.querier != nil { - reader.QueryFunc = impl.querier.GetOrgInviteByID - reader.QueryKeyFunc = QueryKeyInt - } - - return reader.Read(ctx) -} - func (impl *BusinessStoreImpl) LinkOrgInviteToUser(ctx context.Context, inviteID int32, user *dbgen.User) error { if impl.querier == nil { return ErrMaintenance diff --git a/pkg/db/generated/org_users.sql.go b/pkg/db/generated/org_users.sql.go index b33a5864..d21435e1 100644 --- a/pkg/db/generated/org_users.sql.go +++ b/pkg/db/generated/org_users.sql.go @@ -11,25 +11,6 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) -const getOrgInviteByID = `-- name: GetOrgInviteByID :one -SELECT org_id, user_id, level, created_at, updated_at, id, email FROM backend.organization_users WHERE id = $1 -` - -func (q *Queries) GetOrgInviteByID(ctx context.Context, id int32) (*OrganizationUser, error) { - row := q.db.QueryRow(ctx, getOrgInviteByID, id) - var i OrganizationUser - err := row.Scan( - &i.OrgID, - &i.UserID, - &i.Level, - &i.CreatedAt, - &i.UpdatedAt, - &i.ID, - &i.Email, - ) - return &i, err -} - const getOrganizationUsers = `-- name: GetOrganizationUsers :many SELECT u.id, u.name, u.email, u.subscription_id, u.created_at, u.updated_at, u.deleted_at, ou.level FROM backend.organization_users ou diff --git a/pkg/db/generated/querier.go b/pkg/db/generated/querier.go index e0c59eb8..95c12382 100644 --- a/pkg/db/generated/querier.go +++ b/pkg/db/generated/querier.go @@ -46,7 +46,6 @@ type Querier interface { GetLock(ctx context.Context, name string) (*Lock, error) GetNotificationTemplateByHash(ctx context.Context, externalID string) (*NotificationTemplate, error) GetOrgAuditLogs(ctx context.Context, arg *GetOrgAuditLogsParams) ([]*GetOrgAuditLogsRow, error) - GetOrgInviteByID(ctx context.Context, id int32) (*OrganizationUser, error) GetOrgProperties(ctx context.Context, arg *GetOrgPropertiesParams) ([]*Property, error) GetOrgPropertiesCount(ctx context.Context, orgID pgtype.Int4) (int64, error) GetOrgPropertyByName(ctx context.Context, arg *GetOrgPropertyByNameParams) (*Property, error) diff --git a/pkg/db/queries/postgres/org_users.sql b/pkg/db/queries/postgres/org_users.sql index 95a3de45..de4c38ab 100644 --- a/pkg/db/queries/postgres/org_users.sql +++ b/pkg/db/queries/postgres/org_users.sql @@ -16,9 +16,6 @@ INSERT INTO backend.organization_users (org_id, user_id, level) VALUES ($1, $2, -- name: InviteEmailToOrg :one INSERT INTO backend.organization_users (org_id, email, level) VALUES ($1, $2, 'invited') RETURNING *; --- name: GetOrgInviteByID :one -SELECT * FROM backend.organization_users WHERE id = $1; - -- name: LinkOrgInviteToUser :one UPDATE backend.organization_users SET user_id = $1, email = NULL, updated_at = NOW()