Skip to content

Commit

Permalink
Fix file attachments (thanks revolt)
Browse files Browse the repository at this point in the history
  • Loading branch information
tulpenkiste committed Dec 17, 2024
1 parent 8125741 commit bc0da96
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable require-jsdoc */
import { Match, Switch } from "solid-js";

import { User } from "@upryzing/upryzing.js";
Expand All @@ -18,6 +19,7 @@ import MdDelete from "@material-design-icons/svg/outlined/delete.svg?component-s
import MdReplaceImage from "@material-design-icons/svg/outlined/edit.svg?component-solid";
import MdEditNote from "@material-design-icons/svg/outlined/edit_note.svg?component-solid";
import MdImage from "@material-design-icons/svg/outlined/image.svg?component-solid";
import { state } from "@revolt/state";

export function EditProfileButtons(props: { user: User }) {
const client = useClient();
Expand All @@ -35,11 +37,16 @@ export function EditProfileButtons(props: { user: User }) {
const body = new FormData();
body.append("file", file);

const token = state.auth.getSession()?.token ?? "";

const data = await fetch(
`${client().configuration?.features.autumn.url}/${tag}`,
{
method: "POST",
body,
headers: {
"X-Session-Token": (token)
}
}
).then((res) => res.json());

Expand Down

0 comments on commit bc0da96

Please sign in to comment.