complexGood
Module
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user