From 643adb7f9fac70b84a775eb018f3016519f922b0 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 26 Jul 2020 17:28:32 +0200 Subject: [PATCH] Log warnings when using hardcoded data. Signed-off-by: David Mehren --- docs/dev/2.0.md | 7 +++++++ src/history/history.service.ts | 6 +++++- src/users/users.service.ts | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docs/dev/2.0.md diff --git a/docs/dev/2.0.md b/docs/dev/2.0.md new file mode 100644 index 000000000..9acedac43 --- /dev/null +++ b/docs/dev/2.0.md @@ -0,0 +1,7 @@ +# 2.0 Development Hints + +## Dev Setup +- Clone backend and frontend in two folders. +- Run `yarn install` in both projects +- Start the backend server in watch mode using `yarn start:dev`. The backend is then accessible on port 3000. +- Start the frontend dev server using `yarn start`. The frontend is now accessible on port 3001. diff --git a/src/history/history.service.ts b/src/history/history.service.ts index f520cba25..af49772b8 100644 --- a/src/history/history.service.ts +++ b/src/history/history.service.ts @@ -1,11 +1,14 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; import { HistoryEntryUpdateDto } from './history-entry-update.dto'; import { HistoryEntryDto } from './history-entry.dto'; @Injectable() export class HistoryService { + private readonly logger = new Logger(HistoryService.name); + getUserHistory(username: string): HistoryEntryDto[] { //TODO: Use the database + this.logger.warn('Using hardcoded data!'); return [ { metadata: { @@ -44,6 +47,7 @@ export class HistoryService { updateDto: HistoryEntryUpdateDto, ): HistoryEntryDto { //TODO: Use the database + this.logger.warn('Using hardcoded data!'); return { metadata: { alias: null, diff --git a/src/users/users.service.ts b/src/users/users.service.ts index ade4cad3a..c558775ac 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -1,10 +1,13 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; import { UserInfoDto } from './user-info.dto'; @Injectable() export class UsersService { + private readonly logger = new Logger(UsersService.name); + getUserInfo(): UserInfoDto { //TODO: Use the database + this.logger.warn('Using hardcoded data!'); return { displayName: 'foo', userName: 'fooUser',