Skip to content

Commit

Permalink
fix: add missing content-type header (#887)
Browse files Browse the repository at this point in the history
* fix: add missing headers when commenting on an issue

* fix: more missing content-type headers in post requests
  • Loading branch information
Fallenbagel authored Jul 24, 2024
1 parent 5cc4389 commit 2be9c7d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/IssueDetails/IssueComment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ const IssueComment = ({
`/api/v1/issueComment/${comment.id}`,
{
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ message: values.newMessage }),
}
);
Expand Down
6 changes: 6 additions & 0 deletions src/components/IssueDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ const IssueDetails = () => {
try {
const res = await fetch(`/api/v1/issueComment/${firstComment.id}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ message: newMessage }),
});
if (!res.ok) throw new Error();
Expand Down Expand Up @@ -501,6 +504,9 @@ const IssueDetails = () => {
`/api/v1/issue/${issueData?.id}/comment`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ message: values.message }),
}
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/Login/AddEmailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ const AddEmailModal: React.FC<AddEmailModalProps> = ({
try {
const res = await fetch('/api/v1/auth/jellyfin', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
username: username,
password: password,
Expand Down
3 changes: 3 additions & 0 deletions src/components/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const Login = () => {
try {
const res = await fetch('/api/v1/auth/plex', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ authToken }),
});
if (!res.ok) throw new Error();
Expand Down

0 comments on commit 2be9c7d

Please sign in to comment.