mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 04:14:30 +00:00
refactor(api): enforce layered architecture by moving db queries to core services
This commit is contained in:
@@ -275,6 +275,17 @@ export class SkillService {
|
||||
return { name, description }
|
||||
}
|
||||
|
||||
async getSkill(id: string) {
|
||||
const s = await this.prismaClient.skill.findUnique({
|
||||
where: { id },
|
||||
})
|
||||
if (!s) return null
|
||||
return {
|
||||
...this.toSkillInfo(s),
|
||||
teamId: s.teamId,
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private toSkillInfo(s: any): SkillInfo {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user