The History PR: I - Move to redux (#1156)

This commit is contained in:
Erik Michelson 2021-04-22 22:46:24 +02:00 committed by GitHub
parent bba2b207c4
commit 8e5a667d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 629 additions and 417 deletions

View file

@ -0,0 +1,33 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { HistoryEntry, HistoryEntryOrigin } from '../../redux/history/types'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => {
return {
origin: HistoryEntryOrigin.REMOTE,
title: entryDto.title,
pinStatus: entryDto.pinStatus,
identifier: entryDto.identifier,
tags: entryDto.tags,
lastVisited: entryDto.lastVisited
}
}
export const historyEntryToHistoryEntryPutDto = (entry: HistoryEntry): HistoryEntryPutDto => {
return {
pinStatus: entry.pinStatus,
lastVisited: entry.lastVisited,
note: entry.identifier
}
}
export const historyEntryToHistoryEntryUpdateDto = (entry: HistoryEntry): HistoryEntryUpdateDto => {
return {
pinStatus: entry.pinStatus
}
}