add: policy achievements
This commit is contained in:
parent
d90b08720a
commit
973373426a
7 changed files with 83 additions and 13 deletions
|
@ -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}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue