File

src/outbound/nps/nps.controller.ts

Prefix

/nps

Index

Methods

Methods

Async findClientsByRealm
findClientsByRealm(req)
Decorators :
@Get('/client/by-realm')
Parameters :
Name Optional
req No
Returns : Promise<number[]>
Async findUserClientInfo
findUserClientInfo(req)
Decorators :
@Get('/user-client-info')
Parameters :
Name Optional
req No
Returns : Promise<any>
Async getEmails
getEmails(query)
Decorators :
@Get('/emails')
@ApiQuery({name: 'page', type: 'number', required: true, example: 0})
@ApiQuery({name: 'size', type: 'number', required: true, example: 10})
@ApiQuery({name: 'email', type: 'string', required: false})
Parameters :
Name Optional
query No
import { Controller, Get, Param, Query, Req } from '@nestjs/common';
import { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';
import { PaginateQuery } from 'src/types/paginate-query';
import { PaginatedResult } from 'src/types/paginated-result';
import { NpsService } from './nps.service';
import { Client } from 'src/entities/client';
import { User } from 'src/entities/user';

@ApiTags('NPS')
@ApiBearerAuth('token')
@Controller('/nps')
export class NpsController {
  constructor(private readonly npsService: NpsService) {}

  @Get('/emails')
  @ApiQuery({ name: 'page', type: 'number', required: true, example: 0 })
  @ApiQuery({ name: 'size', type: 'number', required: true, example: 10 })
  @ApiQuery({ name: 'email', type: 'string', required: false })
  async getEmails(@Query() query): Promise<PaginatedResult<string>> {
    return await this.npsService.findEmails(query);
  }

  @Get('/client/by-realm')
  async findClientsByRealm(@Req() req): Promise<number[]> {
    return await this.npsService.findClientsByRealm(req.session.realm);
  }

  @Get('/user-client-info')
  async findUserClientInfo(@Req() req): Promise<any> {
    return await this.npsService.findUserClientInfo(req.session);
  }
}

results matching ""

    No results matching ""