Apply request to display status
This commit is contained in:
parent
cb8a36023d
commit
825eb8bf39
|
@ -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 New Issue