From 69facc4fc95a7f6055086fc9ac51622b760a8193 Mon Sep 17 00:00:00 2001 From: SmitGala Date: Fri, 17 Jan 2025 13:53:54 +0530 Subject: [PATCH] Fix: Changed Payload Content type where required --- .../account-settings/general/select-language/index.ts | 7 +++++-- app/components/file-details/static-scan/index.ts | 11 ++++++++++- .../components/file-details/static-scan-test.js | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/components/account-settings/general/select-language/index.ts b/app/components/account-settings/general/select-language/index.ts index fb48fca6a..69d70cdaa 100644 --- a/app/components/account-settings/general/select-language/index.ts +++ b/app/components/account-settings/general/select-language/index.ts @@ -10,7 +10,7 @@ import ENV from 'irene/config/environment'; import parseError from 'irene/utils/parse-error'; import type DatetimeService from 'irene/services/datetime'; import type IreneAjaxService from 'irene/services/ajax'; -import type { AjaxError } from 'irene/services/ajax'; +import { buildURLEncodedFormData, type AjaxError } from 'irene/services/ajax'; const localeStrings = { en: 'English', @@ -67,7 +67,10 @@ export default class AccountSettingsGeneralSelectLanguageComponent extends Compo }; try { - await this.ajax.post(ENV.endpoints['lang'] as string, { data }); + await this.ajax.post(ENV.endpoints['lang'] as string, { + data: buildURLEncodedFormData(data), + contentType: 'application/x-www-form-urlencoded', + }); if (!this.isDestroyed) { window.location.reload(); diff --git a/app/components/file-details/static-scan/index.ts b/app/components/file-details/static-scan/index.ts index a728f5ad9..8d31dd0dc 100644 --- a/app/components/file-details/static-scan/index.ts +++ b/app/components/file-details/static-scan/index.ts @@ -94,7 +94,16 @@ export default class FileDetailsStaticScan extends Component {}); + this.server.post('/v2/files/:id/rescan', () => {}); } await render(hbs``);