Skip to content

Commit

Permalink
fix: use downloadUrl, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
czosel committed Dec 7, 2023
1 parent 0f8c9c2 commit ed64573
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions addon/adapters/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ApplicationAdapter from "./application";

export default class FileAdapter extends ApplicationAdapter {
ajaxOptions(url, type, options) {
console.log(url, type, options);
const ajaxOptions = super.ajaxOptions(url, type, options);

if (type === "PUT") {
Expand All @@ -14,7 +13,6 @@ export default class FileAdapter extends ApplicationAdapter {
if (type === "PUT" || type === "POST") {
// Remove content type for updating and creating records so the content
// type will be defined by the passed form data
console.log("removing content-type header from", ajaxOptions.headers);
delete ajaxOptions.headers["content-type"];
}

Expand Down
2 changes: 1 addition & 1 deletion addon/models/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export default class DocumentModel extends LocalizedModel {
const thumbnail = this.files.filter(
(file) => file.variant === "thumbnail",
)[0];
return thumbnail && thumbnail.content;
return thumbnail && thumbnail.downloadUrl;
}
}
1 change: 1 addition & 0 deletions addon/models/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Model, { attr, belongsTo, hasMany } from "@ember-data/model";
export default class FileModel extends Model {
@attr variant;
@attr name;
@attr downloadUrl;
@attr metainfo;
@attr content;
@attr checksum;
Expand Down

0 comments on commit ed64573

Please sign in to comment.