fixed create/edit rant request
This commit is contained in:
parent
fa362e24b6
commit
bf033acc93
@ -360,7 +360,7 @@ public extension DevRantRequest {
|
||||
|
||||
var parameters = config.urlParameters
|
||||
|
||||
parameters["content"] = text
|
||||
parameters["rant"] = text
|
||||
parameters["tags"] = tags
|
||||
parameters["type"] = String(kind.rawValue)
|
||||
|
||||
@ -411,11 +411,10 @@ public extension DevRantRequest {
|
||||
/// - Parameters:
|
||||
/// - token: The token from the `logIn` call response.
|
||||
/// - rantId: The id of the rant.
|
||||
/// - kind: The type of the rant.
|
||||
/// - text: The text content of the rant.
|
||||
/// - tags: The rants's associated tags.
|
||||
/// - image: An image to attach to the rant.
|
||||
func editRant(token: AuthToken, rantId: Int, kind: Rant.Kind, text: String, tags: String, image: Data?, imageConversion: [ImageDataConverter] = [.unsupportedToJpeg]) async throws {
|
||||
func editRant(token: AuthToken, rantId: Int, text: String, tags: String, image: Data?, imageConversion: [ImageDataConverter] = [.unsupportedToJpeg]) async throws {
|
||||
let boundary = UUID().uuidString
|
||||
|
||||
let config = makeMultipartConfig(.post, path: "devrant/rants/\(rantId)", boundary: boundary, token: token)
|
||||
@ -424,7 +423,6 @@ public extension DevRantRequest {
|
||||
|
||||
parameters["rant"] = text
|
||||
parameters["tags"] = tags
|
||||
parameters["type"] = String(kind.rawValue)
|
||||
|
||||
let convertedImage = image.flatMap { imageConversion.convert($0) }
|
||||
|
||||
|
@ -10,7 +10,8 @@ public struct Link: Hashable, Sendable {
|
||||
/// The full URL.
|
||||
public let url: String
|
||||
|
||||
public let shortURL: String? //TODO: what is this and what is it used for?
|
||||
/// No idea what this is and what it is supposed to be used for.
|
||||
public let shortURL: String?
|
||||
|
||||
/// The url as it is visible in the text of the rant or comment.
|
||||
public let title: String
|
||||
|
Loading…
Reference in New Issue
Block a user