From 1154894876e8f0e5ccb505dc8027ed0ef6d42960 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sat, 10 Apr 2021 23:26:58 +0200 Subject: [PATCH] PrivateAPI: Rename HistoryEntryCreationDto to HistoryEntryImportDto As the DTO is used to import a whole list of history entries rather than creating a single history entry (there is no way of doing that at the moment) Signed-off-by: Philip Molares --- src/api/private/me/history/history.controller.ts | 4 ++-- ...tory-entry-creation.dto.ts => history-entry-import.dto.ts} | 2 +- test/private-api/history.e2e-spec.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/history/{history-entry-creation.dto.ts => history-entry-import.dto.ts} (86%) diff --git a/src/api/private/me/history/history.controller.ts b/src/api/private/me/history/history.controller.ts index 85203b78b..3274720c5 100644 --- a/src/api/private/me/history/history.controller.ts +++ b/src/api/private/me/history/history.controller.ts @@ -19,7 +19,7 @@ import { UsersService } from '../../../../users/users.service'; import { NotesService } from '../../../../notes/notes.service'; import { HistoryEntryDto } from '../../../../history/history-entry.dto'; import { NotInDBError } from '../../../../errors/errors'; -import { HistoryEntryCreationDto } from '../../../../history/history-entry-creation.dto'; +import { HistoryEntryImportDto } from '../../../../history/history-entry-import.dto'; import { HistoryEntryUpdateDto } from '../../../../history/history-entry-update.dto'; import { ConsoleLoggerService } from '../../../../logger/console-logger.service'; import { HistoryService } from '../../../../history/history.service'; @@ -55,7 +55,7 @@ export class HistoryController { @Post() async setHistory( - @Body('history') history: HistoryEntryCreationDto[], + @Body('history') history: HistoryEntryImportDto[], ): Promise { try { // ToDo: use actual user here diff --git a/src/history/history-entry-creation.dto.ts b/src/history/history-entry-import.dto.ts similarity index 86% rename from src/history/history-entry-creation.dto.ts rename to src/history/history-entry-import.dto.ts index aa565ca1d..122024f3f 100644 --- a/src/history/history-entry-creation.dto.ts +++ b/src/history/history-entry-import.dto.ts @@ -6,7 +6,7 @@ import { IsString } from 'class-validator'; -export class HistoryEntryCreationDto { +export class HistoryEntryImportDto { /** * ID or Alias of the note */ diff --git a/test/private-api/history.e2e-spec.ts b/test/private-api/history.e2e-spec.ts index 74aee331a..0295e9c3d 100644 --- a/test/private-api/history.e2e-spec.ts +++ b/test/private-api/history.e2e-spec.ts @@ -26,7 +26,7 @@ import { UsersModule } from '../../src/users/users.module'; import { PrivateApiModule } from '../../src/api/private/private-api.module'; import { HistoryService } from '../../src/history/history.service'; import { Note } from '../../src/notes/note.entity'; -import { HistoryEntryCreationDto } from '../../src/history/history-entry-creation.dto'; +import { HistoryEntryImportDto } from '../../src/history/history-entry-import.dto'; describe('History', () => { let app: INestApplication; @@ -100,7 +100,7 @@ describe('History', () => { }); it('POST /me/history', async () => { - const postEntryDto = new HistoryEntryCreationDto(); + const postEntryDto = new HistoryEntryImportDto(); postEntryDto.note = note2.alias; await request(app.getHttpServer()) .post('/me/history')