mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
refactor(history-entry-import-dto): rename lastVisited -> lastVisitedAt
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
2605e8894d
commit
e7ca10bb66
4 changed files with 8 additions and 8 deletions
|
@ -34,7 +34,7 @@ export class HistoryEntryImportDto extends BaseDto {
|
|||
*/
|
||||
@IsDate()
|
||||
@Type(() => Date)
|
||||
lastVisited: Date;
|
||||
lastVisitedAt: Date;
|
||||
}
|
||||
|
||||
export class HistoryEntryImportListDto extends BaseDto {
|
||||
|
|
|
@ -356,14 +356,14 @@ describe('HistoryService', () => {
|
|||
const note = Note.create(user, alias) as Note;
|
||||
const historyEntry = HistoryEntry.create(user, note);
|
||||
const historyEntryImport: HistoryEntryImportDto = {
|
||||
lastVisited: new Date('2020-12-01 12:23:34'),
|
||||
lastVisitedAt: new Date('2020-12-01 12:23:34'),
|
||||
note: alias,
|
||||
pinStatus: true,
|
||||
};
|
||||
const newlyCreatedHistoryEntry: HistoryEntry = {
|
||||
...historyEntry,
|
||||
pinStatus: historyEntryImport.pinStatus,
|
||||
updatedAt: historyEntryImport.lastVisited,
|
||||
updatedAt: historyEntryImport.lastVisitedAt,
|
||||
};
|
||||
const createQueryBuilder = {
|
||||
leftJoinAndSelect: () => createQueryBuilder,
|
||||
|
|
|
@ -162,7 +162,7 @@ export class HistoryService {
|
|||
);
|
||||
const entry = HistoryEntry.create(user, note) as HistoryEntry;
|
||||
entry.pinStatus = historyEntry.pinStatus;
|
||||
entry.updatedAt = historyEntry.lastVisited;
|
||||
entry.updatedAt = historyEntry.lastVisitedAt;
|
||||
await manager.save<HistoryEntry>(entry);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -93,7 +93,7 @@ describe('History', () => {
|
|||
(alias) => alias.primary,
|
||||
)[0].name;
|
||||
postEntryDto.pinStatus = pinStatus;
|
||||
postEntryDto.lastVisited = lastVisited;
|
||||
postEntryDto.lastVisitedAt = lastVisited;
|
||||
await agent
|
||||
.post('/api/private/me/history')
|
||||
.set('Content-Type', 'application/json')
|
||||
|
@ -132,13 +132,13 @@ describe('History', () => {
|
|||
(alias) => alias.primary,
|
||||
)[0].name;
|
||||
postEntryDto.pinStatus = pinStatus;
|
||||
postEntryDto.lastVisited = lastVisited;
|
||||
postEntryDto.lastVisitedAt = lastVisited;
|
||||
});
|
||||
it('with forbiddenId', async () => {
|
||||
const brokenEntryDto = new HistoryEntryImportDto();
|
||||
brokenEntryDto.note = forbiddenNoteId;
|
||||
brokenEntryDto.pinStatus = pinStatus;
|
||||
brokenEntryDto.lastVisited = lastVisited;
|
||||
brokenEntryDto.lastVisitedAt = lastVisited;
|
||||
await agent
|
||||
.post('/api/private/me/history')
|
||||
.set('Content-Type', 'application/json')
|
||||
|
@ -149,7 +149,7 @@ describe('History', () => {
|
|||
const brokenEntryDto = new HistoryEntryImportDto();
|
||||
brokenEntryDto.note = 'i_dont_exist';
|
||||
brokenEntryDto.pinStatus = pinStatus;
|
||||
brokenEntryDto.lastVisited = lastVisited;
|
||||
brokenEntryDto.lastVisitedAt = lastVisited;
|
||||
await agent
|
||||
.post('/api/private/me/history')
|
||||
.set('Content-Type', 'application/json')
|
||||
|
|
Loading…
Reference in a new issue