mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 02:05:28 +00:00
Start migration to revolt.js@5.0.0.
200 error milestone
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import { XCircle } from "@styled-icons/boxicons-regular";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { Servers, Users } from "revolt.js/dist/api/objects";
|
||||
import { Route } from "revolt.js/dist/api/routes";
|
||||
import { Server } from "revolt.js/dist/maps/Servers";
|
||||
|
||||
import styles from "./Panes.module.scss";
|
||||
import { Text } from "preact-i18n";
|
||||
import { useContext, useEffect, useState } from "preact/hooks";
|
||||
|
||||
import { Server } from "../../../mobx";
|
||||
|
||||
import { AppContext } from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
import UserIcon from "../../../components/common/user/UserIcon";
|
||||
@@ -27,7 +25,7 @@ export const Bans = observer(({ server }: Props) => {
|
||||
>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
client.servers.fetchBans(server._id).then(setData as any);
|
||||
server.fetchBans().then(setData as any);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -64,10 +62,7 @@ export const Bans = observer(({ server }: Props) => {
|
||||
onClick={async () => {
|
||||
setDelete([...deleting, x._id.user]);
|
||||
|
||||
await client.servers.unbanUser(
|
||||
server._id,
|
||||
x._id.user,
|
||||
);
|
||||
await server.unbanUser(x._id.user);
|
||||
|
||||
setData({
|
||||
...data,
|
||||
|
||||
Reference in New Issue
Block a user