API lib cleanup, 404 hosts WIP

This commit is contained in:
Jamie Curnow committed 2025-10-02 08:12:36 +10:00
1 parent 058f49ceea
commit 54e036276a
76 files changed
+921 -544

No files matched your search

+6 -2
View File
@@ -1,10 +1,14 @@
import * as api from "./base";
import type { UserExpansion } from "./expansions";
import type { User } from "./models";
export async function getUser(id: number | string = "me", params = {}): Promise<User> {
export async function getUser(id: number | string = "me", expand?: UserExpansion[], params = {}): Promise<User> {
const userId = id ? id : "me";
return await api.get({
url: `/users/${userId}`,
params,
params: {
expand: expand?.join(","),
...params,
},
});
}