File

src/surveys/survey.controller.ts

Prefix

surveys

Index

Methods

Methods

getAllSurveys
getAllSurveys()
Decorators :
@Get('all')

Fetches an array of all survey objects from the database. Returns a Promise that resolves with the survey data.

getWayConditions
getWayConditions(query: literal type)
Decorators :
@Get('')
Parameters :
Name Type Optional
query literal type No
Returns : Promise<ISurvey>
import { Controller, Get, Query } from '@nestjs/common';

import { ISurvey, SurveyListItem } from 'src/models';
import { SurveyService } from './survey.service';

@Controller('surveys')
export class SurveyController {
  constructor(private readonly service: SurveyService) {}

  /**
   * @author Muro
   */
  @Get('')
  getWayConditions(@Query() query: { surveyId: string }): Promise<ISurvey> {
    const { surveyId } = query;
    return this.service.getSurveyConditions(surveyId);
  }

  /**
   * Fetches an array of all survey objects from the database.
   * Returns a Promise that resolves with the survey data.
   *
   * @author Lyons
   */
  @Get('all')
  getAllSurveys(): Promise<SurveyListItem[]> {
    return this.service.getAllSurveys();
  }
}

results matching ""

    No results matching ""