Skip to content

Commit

Permalink
include content-type header in http requests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed Oct 30, 2024
1 parent 9023e1d commit 1a8c4fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { revalidateTag } from "next/cache";

import { RequestMethod } from "@constants";
import { config } from "@services";

import type {
AddDiscToBagParams,
Bag,
Expand Down Expand Up @@ -80,7 +79,7 @@ export const deleteBag = async ({ bagId }: DeleteBagParams) => {
const request = ({ path, method, body, tags, cache }: RequestParams) =>
fetch(`${config.API_URL}${path}`, {
method,
headers: { Authorization: `Bearer ${config.API_KEY}` },
headers: { Authorization: `Bearer ${config.API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify(body),
next: { tags },
...(cache && { cache })
Expand Down

0 comments on commit 1a8c4fd

Please sign in to comment.