complexGood

Module
This commit is contained in:
2026-03-16 20:59:13 +03:30
parent 69e9a0d082
commit 63fa2bc67e
8 changed files with 244 additions and 3 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { Controller, Get } from '@nestjs/common'
import { Controller, Get, Param } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { CatalogsService } from './catalog.service'
@@ -26,4 +26,9 @@ export class CatalogsController {
async getDeviceBrands() {
return this.catalogService.getDeviceBrands()
}
@Get('guilds/:guildId/good_categories')
async getGuildGoodCategories(@Param('guildId') guild_id: string) {
return this.catalogService.getGuildGoodCategories(guild_id)
}
}
+10
View File
@@ -38,4 +38,14 @@ export class CatalogsService {
})
return ResponseMapper.list(items)
}
async getGuildGoodCategories(guild_id: string) {
const items = await this.prisma.goodCategory.findMany({
where: {
guild_id,
},
select: this.defaultSelect,
})
return ResponseMapper.list(items)
}
}