Generate filtering/sorting and searchable dropdowns
Includes backend q search + generated list UX from DSL.
This commit is contained in:
@@ -6,11 +6,11 @@ import { UpdateEquipmentDto } from './dto/update-equipment.dto';
|
||||
|
||||
@Controller('equipment')
|
||||
export class EquipmentController {
|
||||
constructor(private readonly equipmentService: EquipmentService) {}
|
||||
constructor(private readonly service: EquipmentService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@Query() query: any, @Res() res: Response) {
|
||||
const result = await this.equipmentService.findAll(query);
|
||||
const result = await this.service.findAll(query);
|
||||
res.set('Content-Range', `equipment ${query._start || 0}-${query._end || result.total}/${result.total}`);
|
||||
res.set('Access-Control-Expose-Headers', 'Content-Range');
|
||||
return res.json(result.data);
|
||||
@@ -18,21 +18,21 @@ export class EquipmentController {
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.equipmentService.findOne(id);
|
||||
return this.service.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() dto: CreateEquipmentDto) {
|
||||
return this.equipmentService.create(dto);
|
||||
return this.service.create(dto);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() dto: UpdateEquipmentDto) {
|
||||
return this.equipmentService.update(id, dto);
|
||||
return this.service.update(id, dto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.equipmentService.remove(id);
|
||||
return this.service.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user