mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-22 13:37:01 +00:00
Apply request to display status
This commit is contained in:
parent
cb8a36023d
commit
825eb8bf39
1 changed files with 3 additions and 3 deletions
|
@ -18,9 +18,9 @@ public struct StatusService {
|
|||
|
||||
public extension StatusService {
|
||||
func toggleFavorited() -> AnyPublisher<Never, Error> {
|
||||
networkClient.request(status.favourited
|
||||
? StatusEndpoint.unfavourite(id: status.id)
|
||||
: StatusEndpoint.favourite(id: status.id))
|
||||
networkClient.request(status.displayStatus.favourited
|
||||
? StatusEndpoint.unfavourite(id: status.displayStatus.id)
|
||||
: StatusEndpoint.favourite(id: status.displayStatus.id))
|
||||
.map { ([$0], nil) }
|
||||
.flatMap(contentDatabase.insert(statuses:timeline:))
|
||||
.eraseToAnyPublisher()
|
||||
|
|
Loading…
Reference in a new issue