add: policy achievements

This commit is contained in:
trisua 2025-06-30 18:49:41 -04:00
parent d90b08720a
commit 973373426a
7 changed files with 83 additions and 13 deletions

View file

@ -342,6 +342,27 @@
},
);
self.define("achievement", async (_, name) => {
fetch("/api/v1/auth/user/me/achievement", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
name,
}),
})
.then((res) => res.json())
.then((res) => {
if (!res.ok) {
trigger("atto::toast", [
res.ok ? "success" : "error",
res.message,
]);
}
});
});
self.define("report", (_, asset, asset_type) => {
window.open(
`/mod_panel/file_report?asset=${asset}&asset_type=${asset_type}`,