Make extended-description-download work properly (IOS-20)

APIService was missing and URL was wrong
This commit is contained in:
Nathan Mattes 2023-10-09 17:07:22 +02:00
parent cdf0aa98e6
commit ba2f1f5f40
3 changed files with 7 additions and 3 deletions

View File

@ -24,4 +24,8 @@ extension APIService {
) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.V2.Instance>, Error> { ) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.V2.Instance>, Error> {
return Mastodon.API.V2.Instance.instance(session: session, domain: domain) return Mastodon.API.V2.Instance.instance(session: session, domain: domain)
} }
public func extendedDescription(domain: String) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.ExtendedDescription>, Error> {
return Mastodon.API.Instance.extendedDescription(session: session, domain: domain)
}
} }

View File

@ -51,7 +51,7 @@ extension Mastodon.API.Instance {
} }
static func extendedDescriptionEndpointURL(domain: String) -> URL { static func extendedDescriptionEndpointURL(domain: String) -> URL {
return Mastodon.API.endpointURL(domain: domain).appendingPathComponent("extended_description") return Mastodon.API.endpointURL(domain: domain).appendingPathComponent("instance").appendingPathComponent("extended_description")
} }
/// Extended description of the server /// Extended description of the server

View File

@ -8,8 +8,8 @@ extension Mastodon.Entity {
/// ## Reference: /// ## Reference:
/// [Document](https://docs.joinmastodon.org/entities/ExtendedDescription/) /// [Document](https://docs.joinmastodon.org/entities/ExtendedDescription/)
public struct ExtendedDescription: Codable { public struct ExtendedDescription: Codable {
let updatedAt: Date public let updatedAt: Date
let content: String public let content: String
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case updatedAt = "updated_at" case updatedAt = "updated_at"