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 <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-04-10 23:26:58 +02:00 committed by David Mehren
parent fa724c2603
commit 1154894876
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@ import { UsersService } from '../../../../users/users.service';
import { NotesService } from '../../../../notes/notes.service'; import { NotesService } from '../../../../notes/notes.service';
import { HistoryEntryDto } from '../../../../history/history-entry.dto'; import { HistoryEntryDto } from '../../../../history/history-entry.dto';
import { NotInDBError } from '../../../../errors/errors'; 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 { HistoryEntryUpdateDto } from '../../../../history/history-entry-update.dto';
import { ConsoleLoggerService } from '../../../../logger/console-logger.service'; import { ConsoleLoggerService } from '../../../../logger/console-logger.service';
import { HistoryService } from '../../../../history/history.service'; import { HistoryService } from '../../../../history/history.service';
@ -55,7 +55,7 @@ export class HistoryController {
@Post() @Post()
async setHistory( async setHistory(
@Body('history') history: HistoryEntryCreationDto[], @Body('history') history: HistoryEntryImportDto[],
): Promise<void> { ): Promise<void> {
try { try {
// ToDo: use actual user here // ToDo: use actual user here

View file

@ -6,7 +6,7 @@
import { IsString } from 'class-validator'; import { IsString } from 'class-validator';
export class HistoryEntryCreationDto { export class HistoryEntryImportDto {
/** /**
* ID or Alias of the note * ID or Alias of the note
*/ */

View file

@ -26,7 +26,7 @@ import { UsersModule } from '../../src/users/users.module';
import { PrivateApiModule } from '../../src/api/private/private-api.module'; import { PrivateApiModule } from '../../src/api/private/private-api.module';
import { HistoryService } from '../../src/history/history.service'; import { HistoryService } from '../../src/history/history.service';
import { Note } from '../../src/notes/note.entity'; 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', () => { describe('History', () => {
let app: INestApplication; let app: INestApplication;
@ -100,7 +100,7 @@ describe('History', () => {
}); });
it('POST /me/history', async () => { it('POST /me/history', async () => {
const postEntryDto = new HistoryEntryCreationDto(); const postEntryDto = new HistoryEntryImportDto();
postEntryDto.note = note2.alias; postEntryDto.note = note2.alias;
await request(app.getHttpServer()) await request(app.getHttpServer())
.post('/me/history') .post('/me/history')