feat: report page, take action on reports
This commit is contained in:
parent
a0ba712632
commit
cacd3a30b7
14 changed files with 502 additions and 14 deletions
|
@ -81,6 +81,7 @@ export async function apiRequest<TResponse, TRequest = unknown>(
|
|||
|
||||
if (resp.status < 200 || resp.status > 299) {
|
||||
const err = await resp.json();
|
||||
log.error("Received error for request to %s %s:", method, path, err);
|
||||
if ("code" in err) throw new ApiError(err);
|
||||
else throw new ApiError();
|
||||
}
|
||||
|
|
|
@ -71,6 +71,12 @@ export type PartialReport = {
|
|||
target_type: "USER" | "MEMBER";
|
||||
};
|
||||
|
||||
export type ReportDetails = {
|
||||
report: Report;
|
||||
user: User;
|
||||
member?: Member;
|
||||
};
|
||||
|
||||
export type QueriedUser = {
|
||||
user: User;
|
||||
member_list_hidden: boolean;
|
||||
|
@ -80,3 +86,28 @@ export type QueriedUser = {
|
|||
deleted: boolean;
|
||||
auth_methods?: AuthMethod[];
|
||||
};
|
||||
|
||||
export type WarnUserRequest = {
|
||||
reason: string;
|
||||
clear_fields?: ClearableField[];
|
||||
member_id?: string;
|
||||
report_id?: string;
|
||||
};
|
||||
|
||||
export type SuspendUserRequest = {
|
||||
reason: string;
|
||||
clear_profile: boolean;
|
||||
report_id?: string;
|
||||
};
|
||||
|
||||
export enum ClearableField {
|
||||
DisplayName = "DISPLAY_NAME",
|
||||
Avatar = "AVATAR",
|
||||
Bio = "BIO",
|
||||
Links = "LINKS",
|
||||
Names = "NAMES",
|
||||
Pronouns = "PRONOUNS",
|
||||
Fields = "FIELDS",
|
||||
Flags = "FLAGS",
|
||||
CustomPreferences = "CUSTOM_PREFERENCES",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue