Apply request to display status

This commit is contained in:
Justin Mazzocchi 2020-09-02 02:12:42 -07:00
parent cb8a36023d
commit 825eb8bf39
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 3 additions and 3 deletions

View File

@ -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()