feat: add ability to log and display sanctions

This commit is contained in:
2025-08-25 15:55:48 -07:00
parent a9126ec826
commit 908f22d6aa
17 changed files with 19018 additions and 6 deletions
+44
View File
@@ -0,0 +1,44 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Injectable } from "@angular/core";
@Injectable({
providedIn: "root",
})
export class SanctionsService {
public constructor() {}
// eslint-disable-next-line @typescript-eslint/class-methods-use-this -- Getter for static URL.
private get url(): string {
return "http://localhost:20000/sanctions";
}
public async getSanctions(): Promise<
Array<{
number: number;
uuid: string;
type: string;
platform: string;
reason: string;
username: string;
createdAt: string;
}>
> {
const response = await fetch(this.url);
if (!response.ok) {
return [];
}
return (await response.json()) as Array<{
number: number;
uuid: string;
type: string;
platform: string;
reason: string;
username: string;
createdAt: string;
}>;
}
}