PR #24

Merged
pinks merged 11 commits from nameless/eris:pr-main into main 2023-11-17 18:00:14 +00:00
1 changed files with 6 additions and 6 deletions
Showing only changes of commit 5b61576315 - Show all commits

View File

@ -109,12 +109,12 @@ export const adminsRoute = createPathFilter({
}, },
}, },
async ({ params, query }) => { async ({ params, query }) => {
return withAdmin(query, async (chat) => {
const deletedAdminEntry = await adminStore.getById(params.adminId!); const deletedAdminEntry = await adminStore.getById(params.adminId!);
if (!deletedAdminEntry) { if (!deletedAdminEntry) {
return { status: 404, body: { type: "text/plain", data: `Admin not found` } }; return { status: 404, body: { type: "text/plain", data: `Admin not found` } };
} }
const deletedAdminUser = await getUser(deletedAdminEntry.value.tgUserId); const deletedAdminUser = await getUser(deletedAdminEntry.value.tgUserId);
return withUser(query, async (chat) => {
await deletedAdminEntry.delete(); await deletedAdminEntry.delete();
info(`User ${chat.first_name} demoted user ${deletedAdminUser.first_name} from admin`); info(`User ${chat.first_name} demoted user ${deletedAdminUser.first_name} from admin`);
return { return {