Skip to content

Commit

Permalink
feat(APA): use json body instead of url params (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr authored Sep 22, 2024
1 parent 80ea3e4 commit 9c9fb88
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Dialogs/Composer/AttachmentsPageAttachment.vala
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,20 @@ public class Tuba.AttachmentsPageAttachment : Widgets.Attachment.Item {
// When editing, we can only update attachment metadata
// with the whole post
if (!edit_mode) {
var builder = new Json.Builder ();
builder.begin_object ();

builder.set_member_name ("description");
builder.add_string_value (alt_text);

builder.set_member_name ("focus");
builder.add_string_value ("%.2f,%.2f".printf (pos_x, pos_y));

builder.end_object ();

new Request.PUT (@"/api/v1/media/$(id)")
.with_account (accounts.active)
.with_param ("description", alt_text)
.with_param ("focus", "%.2f,%.2f".printf (pos_x, pos_y))
.body_json (builder)
.then (() => {
close_dialogs ();
})
Expand Down

0 comments on commit 9c9fb88

Please sign in to comment.