So. Much. Work.
parent: tbd commit: b05f964
1 | use crate IssueRow; |
2 | use crate Contents; |
3 | use crate; |
4 | use crate IssuesPluginState; |
5 | use crate:: |
6 | |
7 | CreateIssueRequest, IssueCreationError, IssueEditError, IssueEditRequest, |
8 | IssuePostCommentError, IssuePostCommentRequest, IssueQueryError, QueryIssuesRequest, |
9 | , |
10 | Issue, |
11 | ; |
12 | use IntoInternalError; |
13 | use User; |
14 | use ; |
15 | use PgPool; |
16 | |
17 | pub async |
18 | state: IssuesPluginState, |
19 | repository: Repository, |
20 | request: CreateIssueRequest, |
21 | |
22 | // TODO: AUTHN & AUTHZ |
23 | let issue = query_as! |
24 | IssueRow, |
25 | r#"INSERT INTO issues VALUES (null, $1, $2, $3, $4, $5) RETURNING *"#, |
26 | repository.to_string, |
27 | request.author.to_string, |
28 | 0, |
29 | request.name, |
30 | request.contents, |
31 | |
32 | .fetch_one |
33 | .await |
34 | .as_internal_error_with_context?; |
35 | |
36 | Ok |
37 | repository, |
38 | id: issue.id as u32, |
39 | |
40 | |
41 | |
42 | pub async |
43 | state: IssuesPluginState, |
44 | repository: Repository, |
45 | request: QueryIssuesRequest, |
46 | |
47 | // TODO: AUTHN & AUTHZ |
48 | todo! |
49 | |
50 | |
51 | pub async |
52 | state: IssuesPluginState, |
53 | issue: Issue, |
54 | request: IssueEditRequest, |
55 | |
56 | // TODO: AUTHN & AUTHZ |
57 | todo! |
58 | |
59 | |
60 | pub async |
61 | state: IssuesPluginState, |
62 | issue: Issue, |
63 | request: IssuePostCommentRequest, |
64 | |
65 | // TODO: AUTHN & AUTHZ |
66 | todo! |
67 | |
68 | |
69 | pub async |
70 | state: IssuesPluginState, |
71 | issue: Issue, |
72 | |
73 | todo! |
74 | |
75 | |
76 | pub async |
77 | state: IssuesPluginState, |
78 | issue: Issue, |
79 | |
80 | todo! |
81 | |
82 | |
83 | pub async |
84 | state: IssuesPluginState, |
85 | issue: Issue, |
86 | |
87 | todo! |
88 | |
89 | |
90 | pub async |
91 | state: IssuesPluginState, |
92 | issue: Issue, |
93 | name: Name, |
94 | |
95 | todo! |
96 | |
97 | |
98 | pub async |
99 | state: IssuesPluginState, |
100 | issue: Issue, |
101 | |
102 | todo! |
103 | |
104 | |
105 | pub async |
106 | state: IssuesPluginState, |
107 | issue: Issue, |
108 | contents: Contents, |
109 | |
110 | todo! |
111 | |
112 | |
113 | pub async |
114 | state: IssuesPluginState, |
115 | issue: Issue, |
116 | |
117 | todo! |
118 | |
119 |