Skip to content

Commit d432404

Browse files
fugal-dyanehx
authored andcommitted
fix(files): change file-attribute to content
1 parent 816c8d2 commit d432404

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

addon/models/document.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export default class DocumentModel extends LocalizedModel {
2626
const thumbnail = this.files.filter(
2727
(file) => file.variant === "thumbnail",
2828
)[0];
29-
return thumbnail && thumbnail.downloadUrl;
29+
return thumbnail && thumbnail.content;
3030
}
3131
}

addon/models/file.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default class FileModel extends Model {
44
@attr variant;
55
@attr name;
66
@attr metainfo;
7-
@attr path;
7+
@attr content;
88
@attr checksum;
99

1010
@attr createdAt;

addon/serializers/file.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ export default class TemplateSerializer extends JSONSerializer {
1414
serializeIntoHash = null;
1515

1616
serialize(snapshot) {
17-
const { name, variant, path } = snapshot.attributes();
17+
const { name, variant, content} = snapshot.attributes();
1818

1919
const formData = new FormData();
2020

2121
formData.append("name", name);
2222
formData.append("variant", variant);
2323
formData.append("document", snapshot.belongsTo("document").id);
2424

25-
if (path instanceof File) {
26-
formData.append("path", path);
25+
if (content instanceof File) {
26+
formData.append("content", content);
2727
}
2828

2929
return formData;

addon/services/documents.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class DocumentsService extends Service {
6868
document: documentModel,
6969
createdByGroup: this.config.activeGroup,
7070
modifiedByGroup: this.config.activeGroup,
71-
path: file,
71+
content: file,
7272
});
7373
await fileModel.save();
7474

0 commit comments

Comments
 (0)