mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 09:31:35 -04:00
The History PR: I - Move to redux (#1156)
This commit is contained in:
parent
bba2b207c4
commit
8e5a667d18
24 changed files with 629 additions and 417 deletions
33
src/api/history/dto-methods.ts
Normal file
33
src/api/history/dto-methods.ts
Normal 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue