| 1 | import { apiClient, unwrap } from "@/lib/api/client"; |
| 2 | |
| 3 | type RepositoryRef |
| 4 | |
| 5 | /** People to mention or assign whose username starts with `q`, those involved in the repository first; with `q` empty, only the involved. */ |
| 6 | export async function suggestUsers |
| 7 | { username, repo |
| 8 | q: string, |
| 9 | ) { |
| 10 | const data = |
| 11 | apiClient.GET("/api/repositories/{username}/{repo}/suggestions/users |
| 12 | params: { path: { |
| 13 | }), |
| 14 | ); |
| 15 | return data.users |
| 16 | } |
| 17 | |
| 18 | /** Issues and pull requests whose number starts with `q` or whose title contains it, newest first. */ |
| 19 | export async function suggestIssues |
| 20 | { username, repo |
| 21 | q: string, |
| 22 | ) { |
| 23 | const data = |
| 24 | apiClient.GET("/api/repositories/{username}/{repo}/suggestions/issues |
| 25 | params: { path: { |
| 26 | }), |
| 27 | ); |
| 28 | return data.issues |
| 29 | } |