2022-07-29 22:31:38 +02:00
|
|
|
//
|
|
|
|
// DataSourceFacade+Bookmark.swift
|
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by ProtoLimit on 2022/07/29.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
import CoreData
|
|
|
|
import CoreDataStack
|
2022-10-08 07:43:06 +02:00
|
|
|
import MastodonCore
|
2022-07-29 22:31:38 +02:00
|
|
|
|
|
|
|
extension DataSourceFacade {
|
2022-10-08 07:43:06 +02:00
|
|
|
public static func responseToStatusBookmarkAction(
|
2022-09-15 15:28:40 +02:00
|
|
|
provider: UIViewController & NeedsDependency & AuthContextProvider,
|
2022-10-09 14:07:57 +02:00
|
|
|
status: ManagedObjectRecord<Status>
|
2022-07-29 22:31:38 +02:00
|
|
|
) async throws {
|
|
|
|
let selectionFeedbackGenerator = await UISelectionFeedbackGenerator()
|
|
|
|
await selectionFeedbackGenerator.selectionChanged()
|
|
|
|
|
|
|
|
_ = try await provider.context.apiService.bookmark(
|
|
|
|
record: status,
|
2022-10-09 14:07:57 +02:00
|
|
|
authenticationBox: provider.authContext.mastodonAuthenticationBox
|
2022-07-29 22:31:38 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|