discourse/app/assets/javascripts
Osama Sayegh 6f8f6a7726
FIX: Pass upload type correctly to uploads#create (#29600)
Prior to Uppy, the `uploads#create` endpoint used to receive a `type` param that indicated the purpose/target of the upload, such as `avatar`, `site_setting` and so on. With the introduction of Uppy, the `type` param became the MIME type of the file being uploaded, and the purpose/target of the upload became a new param called `upload_type`, however the backend could still use the `type` param (which now contains MIME type) as the purpose/target of the upload if `upload_type` is absent.

We technically don't need to send the MIME type over the network, but it seems like it's done by Uppy and we have no control over the `type` param that Uppy includes:

758de8167b/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js (L146-L151)

This commit does a couple of things:

1. It amends the `uploads#create` endpoint so it always requires the `upload_type` param and doesn't fallback to `type` if `upload_type` is absent
2. It forces consumers of the `UppyUpload` class (and by extension `UppyImageUploader`) to specify `type` of the upload

Internal topic: t/140945.
2024-11-06 07:00:35 +03:00
..
admin DEV: Fetch settings by area name instead of individual settings (#29604) 2024-11-06 06:56:27 +03:00
custom-proxy Build(deps-dev): Bump express from 4.21.0 to 4.21.1 (#29134) 2024-10-09 01:07:01 +02:00
deprecation-silencer DEV: Reformat package.json files (#28733) 2024-09-04 21:14:13 +02:00
dialog-holder Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
discourse FIX: Pass upload type correctly to uploads#create (#29600) 2024-11-06 07:00:35 +03:00
discourse-common Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
discourse-hbr DEV: Reformat package.json files (#28733) 2024-09-04 21:14:13 +02:00
discourse-i18n Build(deps): Bump @embroider/addon-shim in the embroider group (#29524) 2024-10-31 22:31:28 +01:00
discourse-markdown-it Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
discourse-plugins Build(deps-dev): Bump webpack from 5.96.0 to 5.96.1 (#29545) 2024-11-03 16:26:55 +01:00
discourse-widget-hbs Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
docs
ember-addons
ember-cli-progress-ci PERF: Improve production JS build in low-memory environments (#26849) 2024-05-02 11:43:59 +01:00
ember-production-deprecations DEV: Update ember-cli-deprecation-workflow from 2.2.0 to 3.0.1 (#28226) 2024-08-07 17:59:42 +02:00
float-kit Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
locales FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00
pretty-text Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
select-kit Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
theme-transpiler Build(deps): Bump @babel/standalone in the babel group (#29496) 2024-10-30 23:22:37 +01:00
truth-helpers Build(deps): Bump ember-auto-import from 2.9.0 to 2.10.0 (#29606) 2024-11-06 01:06:08 +01:00
.npmrc
handlebars-shim.js
polyfills.js
service-worker.js.erb DEV: allow non focused tab to be primary tab in service worker (#29516) 2024-11-01 09:42:33 +04:00