forked from pinks/eris
fix: withUser -> withAdmin
This commit is contained in:
parent
186224eb52
commit
7818810db7
|
@ -109,12 +109,12 @@ export const adminsRoute = createPathFilter({
|
|||
},
|
||||
},
|
||||
async ({ params, query }) => {
|
||||
return withAdmin(query, async (chat) => {
|
||||
const deletedAdminEntry = await adminStore.getById(params.adminId!);
|
||||
if (!deletedAdminEntry) {
|
||||
return { status: 404, body: { type: "text/plain", data: `Admin not found` } };
|
||||
}
|
||||
const deletedAdminUser = await getUser(deletedAdminEntry.value.tgUserId);
|
||||
return withUser(query, async (chat) => {
|
||||
await deletedAdminEntry.delete();
|
||||
info(`User ${chat.first_name} demoted user ${deletedAdminUser.first_name} from admin`);
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue