src/surveys/survey.controller.ts
surveys
Methods |
getAllSurveys |
getAllSurveys()
|
Decorators :
@Get('all')
|
Defined in src/surveys/survey.controller.ts:26
|
Fetches an array of all survey objects from the database. Returns a Promise that resolves with the survey data.
Returns :
Promise<SurveyListItem[]>
|
getWayConditions | ||||||
getWayConditions(query: literal type)
|
||||||
Decorators :
@Get('')
|
||||||
Defined in src/surveys/survey.controller.ts:14
|
||||||
Parameters :
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();
}
}