MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / ListForAssignment

Method ListForAssignment

server-source-code/internal/store/users.go:279–290  ·  view source on GitHub ↗

ListForAssignment returns active users for assignment dropdowns.

(ctx context.Context)

Source from the content-addressed store, hash-verified

277
278// ListForAssignment returns active users for assignment dropdowns.
279func (s *UsersStore) ListForAssignment(ctx context.Context) ([]models.User, error) {
280 d := s.db.DB(ctx)
281 rows, err := d.Queries.ListActiveUsers(ctx)
282 if err != nil {
283 return nil, err
284 }
285 out := make([]models.User, len(rows))
286 for i := range rows {
287 out[i] = dbUserToModel(rows[i])
288 }
289 return out, nil
290}
291
292// UpdateTfaSecret sets the TFA secret (during setup, before enabled).
293func (s *UsersStore) UpdateTfaSecret(ctx context.Context, userID string, secret *string) error {

Callers

nothing calls this directly

Calls 3

dbUserToModelFunction · 0.85
DBMethod · 0.65
ListActiveUsersMethod · 0.65

Tested by

no test coverage detected