Some changes

This commit is contained in:
2023-11-20 21:52:00 +03:00
parent dde2fc8994
commit 82c2ad53d6
2 changed files with 4 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ export class AdminController {
return await this.adminService.getAdmins();
}
@ApiOperation({ description: 'Check admin is or not' })
@Get('is_admin/:id')
@Get('is-admin/:id')
async isAdmin(@Param('id') id: string) {
return await this.adminService.checkIsAdmin(id);
}

View File

@@ -15,6 +15,7 @@ export class AdminService {
return admins;
} catch (error) {
this.logger.log(`[getAdmin] ${JSON.stringify({ error })}`);
return [];
}
}
async checkIsAdmin(id: string) {
@@ -29,7 +30,8 @@ export class AdminService {
}
return true;
} catch (error) {
this.logger.log(`[checkIsAdmin] ${JSON.stringify({ error })}`);
this.logger.debug(`[checkIsAdmin] ${JSON.stringify({ error })}`);
return false;
}
}
}