NobGit
public anord read

Ledger

Why work hard when you can work easier?

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 86% CSS 10% SQL 3% Shell 1% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/anord/ledger.git
ssh://[email protected]:2222/orgs/anord/ledger.git

Trace

apps/api/src/http/routes/admin.ts

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

admin.ts on main
Author Date Commit Line Code
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
1
import { Router } from "express";
Open commit View diff
1 import { Router } from "express";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
2
import { requireAdmin } from "../middleware/auth.js";
Open commit View diff
2 import { requireAdmin } from "../middleware/auth.js";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
3
import { pool } from "../../db/pool.js";
Open commit View diff
3 import { pool } from "../../db/pool.js";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
4
Open commit View diff
4
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
5
export const adminRouter = Router();
Open commit View diff
5 export const adminRouter = Router();
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
6
adminRouter.use(requireAdmin);
Open commit View diff
6 adminRouter.use(requireAdmin);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
7
Open commit View diff
7
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
8
adminRouter.get("/users", async (_req, res) => {
Open commit View diff
8 adminRouter.get("/users", async (_req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
9
  const result = await pool.query(
Open commit View diff
9 const result = await pool.query(
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
10
    `
Open commit View diff
10 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
11
      SELECT u.id, u.email, u.display_name, r.key AS role_key
Open commit View diff
11 SELECT u.id, u.email, u.display_name, r.key AS role_key
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
12
      FROM users u
Open commit View diff
12 FROM users u
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
13
      JOIN roles r ON r.id = u.primary_role_id
Open commit View diff
13 JOIN roles r ON r.id = u.primary_role_id
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
14
      ORDER BY u.created_at ASC
Open commit View diff
14 ORDER BY u.created_at ASC
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
15
    `
Open commit View diff
15 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
16
  );
Open commit View diff
16 );
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
17
  return res.json({ users: result.rows });
Open commit View diff
17 return res.json({ users: result.rows });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
18
});
Open commit View diff
18 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
19
Open commit View diff
19
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
20
adminRouter.get("/groups", async (_req, res) => {
Open commit View diff
20 adminRouter.get("/groups", async (_req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
21
  const result = await pool.query(`SELECT * FROM groups ORDER BY name ASC`);
Open commit View diff
21 const result = await pool.query(`SELECT * FROM groups ORDER BY name ASC`);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
22
  return res.json({ groups: result.rows });
Open commit View diff
22 return res.json({ groups: result.rows });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
23
});
Open commit View diff
23 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
24
Open commit View diff
24
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
25
adminRouter.get("/feedback", async (_req, res) => {
Open commit View diff
25 adminRouter.get("/feedback", async (_req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
26
  const result = await pool.query(
Open commit View diff
26 const result = await pool.query(
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
27
    `
Open commit View diff
27 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
28
      SELECT f.*, p.title AS page_title
Open commit View diff
28 SELECT f.*, p.title AS page_title
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
29
      FROM feedback f
Open commit View diff
29 FROM feedback f
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
30
      JOIN pages p ON p.id = f.page_id
Open commit View diff
30 JOIN pages p ON p.id = f.page_id
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
31
      ORDER BY f.created_at DESC
Open commit View diff
31 ORDER BY f.created_at DESC
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
32
      LIMIT 100
Open commit View diff
32 LIMIT 100
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
33
    `
Open commit View diff
33 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
34
  );
Open commit View diff
34 );
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
35
  return res.json({ feedback: result.rows });
Open commit View diff
35 return res.json({ feedback: result.rows });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
36
});
Open commit View diff
36 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
37
Open commit View diff
37
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
38
adminRouter.get("/search-analytics", async (_req, res) => {
Open commit View diff
38 adminRouter.get("/search-analytics", async (_req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
39
  const topSearches = await pool.query(
Open commit View diff
39 const topSearches = await pool.query(
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
40
    `
Open commit View diff
40 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
41
      SELECT query, COUNT(*)::int AS count
Open commit View diff
41 SELECT query, COUNT(*)::int AS count
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
42
      FROM searches
Open commit View diff
42 FROM searches
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
43
      GROUP BY query
Open commit View diff
43 GROUP BY query
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
44
      ORDER BY count DESC, query ASC
Open commit View diff
44 ORDER BY count DESC, query ASC
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
45
      LIMIT 10
Open commit View diff
45 LIMIT 10
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
46
    `
Open commit View diff
46 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
47
  );
Open commit View diff
47 );
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
48
Open commit View diff
48
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
49
  const noResults = await pool.query(
Open commit View diff
49 const noResults = await pool.query(
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
50
    `
Open commit View diff
50 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
51
      SELECT query, COUNT(*)::int AS count
Open commit View diff
51 SELECT query, COUNT(*)::int AS count
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
52
      FROM searches
Open commit View diff
52 FROM searches
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
53
      WHERE results_count = 0
Open commit View diff
53 WHERE results_count = 0
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
54
      GROUP BY query
Open commit View diff
54 GROUP BY query
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
55
      ORDER BY count DESC, query ASC
Open commit View diff
55 ORDER BY count DESC, query ASC
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
56
      LIMIT 10
Open commit View diff
56 LIMIT 10
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
57
    `
Open commit View diff
57 `
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
58
  );
Open commit View diff
58 );
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
59
Open commit View diff
59
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
60
  return res.json({
Open commit View diff
60 return res.json({
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
61
    topSearches: topSearches.rows,
Open commit View diff
61 topSearches: topSearches.rows,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
62
    noResults: noResults.rows
Open commit View diff
62 noResults: noResults.rows
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
63
  });
Open commit View diff
63 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
64
});
Open commit View diff
64 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
65
Open commit View diff
65
Alex Nord 3 months ago ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
66
adminRouter.get("/activity", async (_req, res) => {
Open commit View diff
66 adminRouter.get("/activity", async (_req, res) => {
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
67
  const result = await pool.query(
Open commit View diff
67 const result = await pool.query(
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
68
    `
Open commit View diff
68 `
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
69
      SELECT
Open commit View diff
69 SELECT
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
70
        al.id,
Open commit View diff
70 al.id,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
71
        al.action,
Open commit View diff
71 al.action,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
72
        al.resource_type,
Open commit View diff
72 al.resource_type,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
73
        al.resource_id,
Open commit View diff
73 al.resource_id,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
74
        al.metadata,
Open commit View diff
74 al.metadata,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
75
        al.created_at,
Open commit View diff
75 al.created_at,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
76
        COALESCE(u.display_name, 'System') AS actor_name
Open commit View diff
76 COALESCE(u.display_name, 'System') AS actor_name
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
77
      FROM audit_logs al
Open commit View diff
77 FROM audit_logs al
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
78
      LEFT JOIN users u ON u.id = al.actor_user_id
Open commit View diff
78 LEFT JOIN users u ON u.id = al.actor_user_id
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
79
      ORDER BY al.created_at DESC
Open commit View diff
79 ORDER BY al.created_at DESC
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
80
      LIMIT 100
Open commit View diff
80 LIMIT 100
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
81
    `
Open commit View diff
81 `
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
82
  );
Open commit View diff
82 );
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
83
Open commit View diff
83
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
84
  return res.json({ activity: result.rows });
Open commit View diff
84 return res.json({ activity: result.rows });
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
85
});
Open commit View diff
85 });