PR #24
|
@ -109,12 +109,12 @@ export const adminsRoute = createPathFilter({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async ({ params, query }) => {
|
async ({ params, query }) => {
|
||||||
const deletedAdminEntry = await adminStore.getById(params.adminId!);
|
return withAdmin(query, async (chat) => {
|
||||||
if (!deletedAdminEntry) {
|
const deletedAdminEntry = await adminStore.getById(params.adminId!);
|
||||||
return { status: 404, body: { type: "text/plain", data: `Admin not found` } };
|
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) => {
|
const deletedAdminUser = await getUser(deletedAdminEntry.value.tgUserId);
|
||||||
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 {
|
||||||
|
|
Loading…
Reference in New Issue