DEV: Allow uploadUrl to be based to theme-upload-add modal (#23415)

This commit is contained in:
Isaac Janzen 2023-09-05 15:36:48 -05:00 committed by GitHub
parent d308360376
commit 152a99b3f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,8 @@ export default class ThemeUploadAdd extends Component {
@tracked fileSelected = false;
@tracked flash;
uploadUrl = this.args.model.uploadUrl || "/admin/themes/upload_asset";
get disabled() {
return this.errorMessage && this.fileSelected;
}
@ -97,7 +99,7 @@ export default class ThemeUploadAdd extends Component {
options.data.append("file", file);
try {
const result = await ajax("/admin/themes/upload_asset", options);
const result = await ajax(this.uploadUrl, options);
const upload = {
upload_id: result.upload_id,
name: this.name,