Skip to content

Commit

Permalink
Change Content-Type header
Browse files Browse the repository at this point in the history
That was the problem? Seriously???
  • Loading branch information
FyreByrd committed Oct 7, 2024
1 parent ccedead commit a36f27f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export async function request(
body?: any
) {
const { url, token } = await getURLandToken(organizationId);
console.log(`request: ${JSON.stringify(body)}`); // TODO: remove
return await fetch(`${url}/${resource}`, {
method: method,
headers: {
Authorization: `Bearer ${token}`,
Accept: 'application/json'
Accept: 'application/json',
'Content-Type': body? 'application/json' : undefined
},
body: body ? JSON.stringify(body) : undefined
});
Expand Down Expand Up @@ -91,10 +91,7 @@ export async function createJob(
organizationId: number,
job: Types.JobConfig
): Promise<Types.JobResponse | Types.ErrorResponse> {
console.log(`Requests.createJob job: ${JSON.stringify(job, null, 4)}`); // TODO: remove
const res = await request('job', organizationId, 'POST', job);
console.log(`Requests.createJob res: ${res.status}: ${res.statusText}`); // TODO: remove
console.log(`Requests.createJob res: ${JSON.stringify(await res.json(), null, 4)}`); // TODO: remove
return res.ok
? ((await res.json()) as Types.JobResponse)
: ((await res.json()) as Types.ErrorResponse);
Expand Down
1 change: 1 addition & 0 deletions source/SIL.AppBuilder.Portal/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default defineConfig({
return {
name: 'Run BullMQ Worker',
configureServer(server) {
return;
if (server.config.mode === 'development') {
if (watchProgram) return;
spawn('tsc', ['-w'], {
Expand Down

0 comments on commit a36f27f

Please sign in to comment.