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/services/pages.ts

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

pages.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 type { PageDetail, PageSummary, PageUpsertInput, RoleKey, SessionUser } from "@ledger/shared";
Open commit View diff
1 import type { PageDetail, PageSummary, PageUpsertInput, RoleKey, SessionUser } from "@ledger/shared";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
2
import { canReadVisibility } from "@ledger/shared";
Open commit View diff
2 import { canReadVisibility } from "@ledger/shared";
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
import { renderMarkdown } from "../utils/markdown.js";
Open commit View diff
4 import { renderMarkdown } from "../utils/markdown.js";
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
12
  excerpt: string | null;
Open commit View diff
12 excerpt: string | null;
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
13
  visibility: "public" | "internal" | "restricted";
Open commit View diff
13 visibility: "public" | "internal" | "restricted";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
14
  state: "draft" | "published";
Open commit View diff
14 state: "draft" | "published";
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
23
type SourceRow = {
Open commit View diff
23 type SourceRow = {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
24
  provider: "markdown_import" | "github" | "google_docs";
Open commit View diff
24 provider: "markdown_import" | "github" | "google_docs";
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
25
  source_url: string | null;
Open commit View diff
25 source_url: string | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
26
  source_title: string | null;
Open commit View diff
26 source_title: string | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
27
  source_branch: string | null;
Open commit View diff
27 source_branch: string | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
28
  source_path: string | null;
Open commit View diff
28 source_path: string | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
29
  source_document_id: string | null;
Open commit View diff
29 source_document_id: string | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
30
  imported_at: Date;
Open commit View diff
30 imported_at: Date;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
31
  imported_by: string | null;
Open commit View diff
31 imported_by: string | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
32
  last_synced_at: Date | null;
Open commit View diff
32 last_synced_at: Date | null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
33
};
Open commit View diff
33 };
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
34
Open commit View diff
34
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
35
async function getPagePermissions(pageId: string) {
Open commit View diff
35 async function getPagePermissions(pageId: string) {
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
37
    `SELECT role_key, group_id FROM page_permissions WHERE page_id = $1`,
Open commit View diff
37 `SELECT role_key, group_id FROM page_permissions WHERE page_id = $1`,
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
39
  );
Open commit View diff
39 );
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
  return {
Open commit View diff
41 return {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
42
    roleKeys: permissions.rows.map((row) => row.role_key).filter(Boolean) as RoleKey[],
Open commit View diff
42 roleKeys: permissions.rows.map((row) => row.role_key).filter(Boolean) as RoleKey[],
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
43
    groupIds: permissions.rows.map((row) => row.group_id).filter(Boolean) as string[]
Open commit View diff
43 groupIds: permissions.rows.map((row) => row.group_id).filter(Boolean) as string[]
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
45
}
Open commit View diff
45 }
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
async function getPageTags(pageId: string): Promise<string[]> {
Open commit View diff
47 async function getPageTags(pageId: string): Promise<string[]> {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
52
      JOIN tags t ON t.id = pt.tag_id
Open commit View diff
52 JOIN tags t ON t.id = pt.tag_id
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
56
    [pageId]
Open commit View diff
56 [pageId]
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
  return tags.rows.map((row) => row.name);
Open commit View diff
59 return tags.rows.map((row) => row.name);
same change 4527dbd

First commit v2

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

First commit v2

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

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
62
async function getPageSource(pageId: string) {
Open commit View diff
62 async function getPageSource(pageId: string) {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
63
  const source = await pool.query(
Open commit View diff
63 const source = await pool.query(
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
64
    `
Open commit View diff
64 `
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
65
      SELECT
Open commit View diff
65 SELECT
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
66
        eps.provider,
Open commit View diff
66 eps.provider,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
67
        eps.source_url,
Open commit View diff
67 eps.source_url,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
68
        eps.source_title,
Open commit View diff
68 eps.source_title,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
69
        eps.source_branch,
Open commit View diff
69 eps.source_branch,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
70
        eps.source_path,
Open commit View diff
70 eps.source_path,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
71
        eps.source_document_id,
Open commit View diff
71 eps.source_document_id,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
72
        eps.imported_at,
Open commit View diff
72 eps.imported_at,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
73
        COALESCE(u.display_name, 'Unknown') AS imported_by,
Open commit View diff
73 COALESCE(u.display_name, 'Unknown') AS imported_by,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
74
        eps.last_synced_at
Open commit View diff
74 eps.last_synced_at
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
75
      FROM external_page_sources eps
Open commit View diff
75 FROM external_page_sources eps
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
76
      LEFT JOIN users u ON u.id = eps.imported_by_user_id
Open commit View diff
76 LEFT JOIN users u ON u.id = eps.imported_by_user_id
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
77
      WHERE eps.page_id = $1
Open commit View diff
77 WHERE eps.page_id = $1
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
78
    `,
Open commit View diff
78 `,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
79
    [pageId]
Open commit View diff
79 [pageId]
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
80
  );
Open commit View diff
80 );
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

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

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
82
  if (!source.rowCount) {
Open commit View diff
82 if (!source.rowCount) {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
83
    return null;
Open commit View diff
83 return null;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
84
  }
Open commit View diff
84 }
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
85
Open commit View diff
85
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
86
  const row = source.rows[0] as SourceRow;
Open commit View diff
86 const row = source.rows[0] as SourceRow;
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
87
  return {
Open commit View diff
87 return {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
88
    provider: row.provider,
Open commit View diff
88 provider: row.provider,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
89
    sourceUrl: row.source_url,
Open commit View diff
89 sourceUrl: row.source_url,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
90
    sourceTitle: row.source_title,
Open commit View diff
90 sourceTitle: row.source_title,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
91
    sourceBranch: row.source_branch,
Open commit View diff
91 sourceBranch: row.source_branch,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
92
    sourcePath: row.source_path,
Open commit View diff
92 sourcePath: row.source_path,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
93
    sourceDocumentId: row.source_document_id,
Open commit View diff
93 sourceDocumentId: row.source_document_id,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
94
    importedAt: row.imported_at.toISOString(),
Open commit View diff
94 importedAt: row.imported_at.toISOString(),
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
95
    importedBy: row.imported_by,
Open commit View diff
95 importedBy: row.imported_by,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
96
    lastSyncedAt: row.last_synced_at?.toISOString() ?? null
Open commit View diff
96 lastSyncedAt: row.last_synced_at?.toISOString() ?? null
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
97
  };
Open commit View diff
97 };
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
98
}
Open commit View diff
98 }
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
99
Open commit View diff
99
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
100
function toSummary(row: PageRecord, tags: string[]): PageSummary {
Open commit View diff
100 function toSummary(row: PageRecord, tags: string[]): PageSummary {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
112
    updatedAt: row.updated_at.toISOString()
Open commit View diff
112 updatedAt: row.updated_at.toISOString()
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
116
async function upsertTags(pageId: string, tagNames: string[] = []) {
Open commit View diff
116 async function upsertTags(pageId: string, tagNames: string[] = []) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
117
  await pool.query("DELETE FROM page_tags WHERE page_id = $1", [pageId]);
Open commit View diff
117 await pool.query("DELETE FROM page_tags WHERE page_id = $1", [pageId]);
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
119
  for (const tagName of tagNames) {
Open commit View diff
119 for (const tagName of tagNames) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
120
    const normalized = tagName.trim().toLowerCase();
Open commit View diff
120 const normalized = tagName.trim().toLowerCase();
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
125
        INSERT INTO tags (name)
Open commit View diff
125 INSERT INTO tags (name)
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
126
        VALUES ($1)
Open commit View diff
126 VALUES ($1)
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
127
        ON CONFLICT (name) DO UPDATE SET name = EXCLUDED.name
Open commit View diff
127 ON CONFLICT (name) DO UPDATE SET name = EXCLUDED.name
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
134
      `INSERT INTO page_tags (page_id, tag_id) VALUES ($1, $2) ON CONFLICT DO NOTHING`,
Open commit View diff
134 `INSERT INTO page_tags (page_id, tag_id) VALUES ($1, $2) ON CONFLICT DO NOTHING`,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
135
      [pageId, tag.rows[0].id]
Open commit View diff
135 [pageId, tag.rows[0].id]
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
142
  allowedRoleKeys: RoleKey[] = [],
Open commit View diff
142 allowedRoleKeys: RoleKey[] = [],
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
145
  await pool.query("DELETE FROM page_permissions WHERE page_id = $1", [pageId]);
Open commit View diff
145 await pool.query("DELETE FROM page_permissions WHERE page_id = $1", [pageId]);
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
147
  for (const roleKey of allowedRoleKeys) {
Open commit View diff
147 for (const roleKey of allowedRoleKeys) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
148
    await pool.query(`INSERT INTO page_permissions (page_id, role_key) VALUES ($1, $2)`, [
Open commit View diff
148 await pool.query(`INSERT INTO page_permissions (page_id, role_key) VALUES ($1, $2)`, [
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
154
  for (const groupId of allowedGroupIds) {
Open commit View diff
154 for (const groupId of allowedGroupIds) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
155
    await pool.query(`INSERT INTO page_permissions (page_id, group_id) VALUES ($1, $2)`, [
Open commit View diff
155 await pool.query(`INSERT INTO page_permissions (page_id, group_id) VALUES ($1, $2)`, [
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
162
export async function listSpaces(user: SessionUser | null) {
Open commit View diff
162 export async function listSpaces(user: SessionUser | null) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
163
  const result = await pool.query(`SELECT id, name, key, visibility FROM spaces ORDER BY name ASC`);
Open commit View diff
163 const result = await pool.query(`SELECT id, name, key, visibility FROM spaces 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
164
  return result.rows.filter((row) => canReadVisibility(user, row.visibility, [], []));
Open commit View diff
164 return result.rows.filter((row) => canReadVisibility(user, row.visibility, [], []));
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
167
export async function listPagesForSpace(spaceKey: string, user: SessionUser | null) {
Open commit View diff
167 export async function listPagesForSpace(spaceKey: string, user: SessionUser | null) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
168
  const result = await pool.query(
Open commit View diff
168 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
169
    `
Open commit View diff
169 `
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
171
        p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
Open commit View diff
171 p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
172
        p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
Open commit View diff
172 p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
173
        COALESCE(u.display_name, 'Unknown') AS author_name
Open commit View diff
173 COALESCE(u.display_name, 'Unknown') AS author_name
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
177
      LEFT JOIN users u ON u.id = pr.edited_by_user_id
Open commit View diff
177 LEFT JOIN users u ON u.id = pr.edited_by_user_id
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
178
      WHERE s.key = $1 AND p.state = 'published'
Open commit View diff
178 WHERE s.key = $1 AND p.state = 'published'
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
184
  const pages: PageSummary[] = [];
Open commit View diff
184 const pages: PageSummary[] = [];
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
185
  for (const row of result.rows as PageRecord[]) {
Open commit View diff
185 for (const row of result.rows as PageRecord[]) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
186
    const permissions = await getPagePermissions(row.id);
Open commit View diff
186 const permissions = await getPagePermissions(row.id);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
187
    if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
Open commit View diff
187 if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
190
    pages.push(toSummary(row, await getPageTags(row.id)));
Open commit View diff
190 pages.push(toSummary(row, await getPageTags(row.id)));
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
196
export async function listDraftPages(user: SessionUser | null) {
Open commit View diff
196 export async function listDraftPages(user: SessionUser | null) {
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
197
  if (!user) {
Open commit View diff
197 if (!user) {
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
201
  const result = await pool.query(
Open commit View diff
201 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
202
    `
Open commit View diff
202 `
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
204
        p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
Open commit View diff
204 p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
205
        p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
Open commit View diff
205 p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
208
      JOIN page_revisions pr ON pr.id = p.current_revision_id
Open commit View diff
208 JOIN page_revisions pr ON pr.id = p.current_revision_id
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
210
      WHERE p.state = 'draft'
Open commit View diff
210 WHERE p.state = 'draft'
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
215
  const drafts: PageSummary[] = [];
Open commit View diff
215 const drafts: PageSummary[] = [];
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
216
  for (const row of result.rows as PageRecord[]) {
Open commit View diff
216 for (const row of result.rows as PageRecord[]) {
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
217
    const permissions = await getPagePermissions(row.id);
Open commit View diff
217 const permissions = await getPagePermissions(row.id);
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
218
    if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
Open commit View diff
218 if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
221
    drafts.push(toSummary(row, await getPageTags(row.id)));
Open commit View diff
221 drafts.push(toSummary(row, await getPageTags(row.id)));
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
226
Open commit View diff
226
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
227
export async function getPageBySlug(slug: string, user: SessionUser | null): Promise<PageDetail | null> {
Open commit View diff
227 export async function getPageBySlug(slug: string, user: SessionUser | null): Promise<PageDetail | null> {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
228
  const result = await pool.query(
Open commit View diff
228 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
229
    `
Open commit View diff
229 `
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
231
        p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
Open commit View diff
231 p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
232
        p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
Open commit View diff
232 p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
233
        COALESCE(u.display_name, 'Unknown') AS author_name
Open commit View diff
233 COALESCE(u.display_name, 'Unknown') AS author_name
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
236
      LEFT JOIN users u ON u.id = pr.edited_by_user_id
Open commit View diff
236 LEFT JOIN users u ON u.id = pr.edited_by_user_id
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
237
      WHERE p.slug = $1
Open commit View diff
237 WHERE p.slug = $1
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
242
  if (!result.rowCount) {
Open commit View diff
242 if (!result.rowCount) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
246
  const row = result.rows[0] as PageRecord;
Open commit View diff
246 const row = result.rows[0] as PageRecord;
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
247
  const permissions = await getPagePermissions(row.id);
Open commit View diff
247 const permissions = await getPagePermissions(row.id);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
248
  if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
Open commit View diff
248 if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
252
  const tags = await getPageTags(row.id);
Open commit View diff
252 const tags = await getPageTags(row.id);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
253
  const rendered = renderMarkdown(row.body_markdown);
Open commit View diff
253 const rendered = renderMarkdown(row.body_markdown);
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
256
    ...toSummary(row, tags),
Open commit View diff
256 ...toSummary(row, tags),
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
260
    revisionId: row.revision_id,
Open commit View diff
260 revisionId: row.revision_id,
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
261
    authorName: row.author_name,
Open commit View diff
261 authorName: row.author_name,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
262
    source: await getPageSource(row.id)
Open commit View diff
262 source: await getPageSource(row.id)
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
266
export async function createOrUpdatePage(existingPageId: string | null, input: PageUpsertInput, actorUserId: string) {
Open commit View diff
266 export async function createOrUpdatePage(existingPageId: string | null, input: PageUpsertInput, actorUserId: string) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
267
  const rendered = renderMarkdown(input.bodyMarkdown);
Open commit View diff
267 const rendered = renderMarkdown(input.bodyMarkdown);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
268
  const slug = slugify(input.slug ?? input.title);
Open commit View diff
268 const slug = slugify(input.slug ?? input.title);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
269
  const isPublic = input.visibility === "public" && input.state === "published";
Open commit View diff
269 const isPublic = input.visibility === "public" && input.state === "published";
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
271
  await pool.query("BEGIN");
Open commit View diff
271 await pool.query("BEGIN");
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
278
              space_id = $2,
Open commit View diff
278 space_id = $2,
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
281
              excerpt = $5,
Open commit View diff
281 excerpt = $5,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
282
              visibility = $6,
Open commit View diff
282 visibility = $6,
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
284
              is_public = $8,
Open commit View diff
284 is_public = $8,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
285
              parent_page_id = $9,
Open commit View diff
285 parent_page_id = $9,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
286
              updated_at = now()
Open commit View diff
286 updated_at = now()
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
295
            input.excerpt ?? null,
Open commit View diff
295 input.excerpt ?? null,
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
299
            input.parentPageId ?? null
Open commit View diff
299 input.parentPageId ?? null
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
305
              space_id, parent_page_id, title, slug, excerpt, visibility, state, is_public, owner_user_id
Open commit View diff
305 space_id, parent_page_id, title, slug, excerpt, visibility, state, is_public, owner_user_id
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
307
            VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
Open commit View diff
307 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
312
            input.parentPageId ?? null,
Open commit View diff
312 input.parentPageId ?? null,
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
315
            input.excerpt ?? null,
Open commit View diff
315 input.excerpt ?? null,
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
323
    const pageId = pageResult.rows[0].id;
Open commit View diff
323 const pageId = pageResult.rows[0].id;
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
328
          page_id, title, slug, excerpt, visibility, state, body_markdown, frontmatter, tag_snapshot, edited_by_user_id
Open commit View diff
328 page_id, title, slug, excerpt, visibility, state, body_markdown, frontmatter, tag_snapshot, edited_by_user_id
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
330
        VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
Open commit View diff
330 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
337
        input.excerpt ?? null,
Open commit View diff
337 input.excerpt ?? null,
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
341
        JSON.stringify(rendered.frontmatter),
Open commit View diff
341 JSON.stringify(rendered.frontmatter),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
342
        JSON.stringify(input.tagNames ?? []),
Open commit View diff
342 JSON.stringify(input.tagNames ?? []),
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
347
    await pool.query(`UPDATE pages SET current_revision_id = $2 WHERE id = $1`, [
Open commit View diff
347 await pool.query(`UPDATE pages SET current_revision_id = $2 WHERE id = $1`, [
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
352
    await upsertTags(pageId, input.tagNames);
Open commit View diff
352 await upsertTags(pageId, input.tagNames);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
353
    await upsertPermissions(pageId, input.allowedRoleKeys, input.allowedGroupIds);
Open commit View diff
353 await upsertPermissions(pageId, input.allowedRoleKeys, input.allowedGroupIds);
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
355
    await pool.query("COMMIT");
Open commit View diff
355 await pool.query("COMMIT");
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
356
    return { pageId, revisionId: revision.rows[0].id, slug };
Open commit View diff
356 return { pageId, revisionId: revision.rows[0].id, slug };
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
358
    await pool.query("ROLLBACK");
Open commit View diff
358 await pool.query("ROLLBACK");
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
363
export async function getPageMetadata(pageId: string, user: SessionUser | null) {
Open commit View diff
363 export async function getPageMetadata(pageId: string, user: SessionUser | null) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
366
      SELECT id, title, slug, visibility, state, updated_at
Open commit View diff
366 SELECT id, title, slug, visibility, state, updated_at
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
373
  if (!page.rowCount) {
Open commit View diff
373 if (!page.rowCount) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
377
  const permissions = await getPagePermissions(pageId);
Open commit View diff
377 const permissions = await getPagePermissions(pageId);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
378
  const row = page.rows[0];
Open commit View diff
378 const row = page.rows[0];
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
380
  if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
Open commit View diff
380 if (!canReadVisibility(user, row.visibility, permissions.roleKeys, permissions.groupIds)) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
390
export async function listPageRevisions(pageId: string, user: SessionUser | null) {
Open commit View diff
390 export async function listPageRevisions(pageId: string, user: SessionUser | null) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
391
  const metadata = await getPageMetadata(pageId, user);
Open commit View diff
391 const metadata = await getPageMetadata(pageId, user);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
392
  if (!metadata) {
Open commit View diff
392 if (!metadata) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
398
      SELECT pr.id, pr.title, pr.slug, pr.visibility, pr.state, pr.created_at,
Open commit View diff
398 SELECT pr.id, pr.title, pr.slug, pr.visibility, pr.state, pr.created_at,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
399
             COALESCE(u.display_name, 'Unknown') AS editor_name
Open commit View diff
399 COALESCE(u.display_name, 'Unknown') AS editor_name
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
401
      LEFT JOIN users u ON u.id = pr.edited_by_user_id
Open commit View diff
401 LEFT JOIN users u ON u.id = pr.edited_by_user_id
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
402
      WHERE pr.page_id = $1
Open commit View diff
402 WHERE pr.page_id = $1
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
411
export async function rollbackPageRevision(pageId: string, revisionId: string, actorUserId: string) {
Open commit View diff
411 export async function rollbackPageRevision(pageId: string, revisionId: string, actorUserId: string) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
412
  const revision = await pool.query(`SELECT * FROM page_revisions WHERE page_id = $1 AND id = $2`, [
Open commit View diff
412 const revision = await pool.query(`SELECT * FROM page_revisions WHERE page_id = $1 AND id = $2`, [
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
417
  if (!revision.rowCount) {
Open commit View diff
417 if (!revision.rowCount) {
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
421
  const currentPage = await pool.query(`SELECT space_id, parent_page_id FROM pages WHERE id = $1`, [pageId]);
Open commit View diff
421 const currentPage = await pool.query(`SELECT space_id, parent_page_id FROM pages WHERE id = $1`, [pageId]);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
422
  const row = revision.rows[0];
Open commit View diff
422 const row = revision.rows[0];
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
441
export async function getSearchCandidates() {
Open commit View diff
441 export async function getSearchCandidates() {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
442
  const result = await pool.query(
Open commit View diff
442 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
443
    `
Open commit View diff
443 `
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
445
        p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
Open commit View diff
445 p.id, p.space_id, p.title, p.slug, p.excerpt, p.visibility, p.state, p.is_public,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
446
        p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
Open commit View diff
446 p.parent_page_id, p.updated_at, pr.id AS revision_id, pr.body_markdown,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
447
        COALESCE(u.display_name, 'Unknown') AS author_name
Open commit View diff
447 COALESCE(u.display_name, 'Unknown') AS author_name
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
450
      LEFT JOIN users u ON u.id = pr.edited_by_user_id
Open commit View diff
450 LEFT JOIN users u ON u.id = pr.edited_by_user_id
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
451
      WHERE p.state = 'published'
Open commit View diff
451 WHERE p.state = 'published'
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
455
  return result.rows as PageRecord[];
Open commit View diff
455 return result.rows as PageRecord[];
same change 4527dbd

First commit v2

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