import { Controller, Get, Param, Query } from '@nestjs/common'; import { LeadService } from '../service/lead.service'; @Controller('lead') export class LeadController { constructor(private readonly leadService: LeadService) {} @Get('organizations') async getAllOrganizations() { return this.leadService.getAllOrganizations(); } @Get('brands/:organizationId') async getBrandsByOrganization( @Param('organizationId') organizationId: number, ) { return this.leadService.getBrandsByOrganization(organizationId); } @Get('schools') async getSchoolsByBrandAndOrganization( @Query('brandId') brandId: number, @Query('organizationId') organizationId: number, ) { return this.leadService.getSchoolsByBrandAndOrganization( brandId, organizationId, ); } }