mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Don't transform raw URLs as if they were attachments
This commit is contained in:
parent
8796f694bc
commit
c94dd7c59d
|
|
@ -306,13 +306,13 @@ export default apiRoute((app) => {
|
|||
if (element instanceof File) {
|
||||
const uploaded = await mediaManager.addFile(element);
|
||||
|
||||
url = uploaded.path;
|
||||
url = Attachment.getUrl(uploaded.path);
|
||||
contentType = uploaded.uploadedFile.type;
|
||||
} else {
|
||||
url = element;
|
||||
}
|
||||
|
||||
modified.url = Attachment.getUrl(url);
|
||||
modified.url = url;
|
||||
modified.contentType = contentType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ export default apiRoute((app) =>
|
|||
|
||||
const uploaded = await mediaManager.addFile(element);
|
||||
|
||||
url = uploaded.path;
|
||||
url = Attachment.getUrl(uploaded.path);
|
||||
contentType = uploaded.uploadedFile.type;
|
||||
} else {
|
||||
url = element;
|
||||
|
|
@ -175,7 +175,7 @@ export default apiRoute((app) =>
|
|||
|
||||
const emoji = await Emoji.insert({
|
||||
shortcode,
|
||||
url: Attachment.getUrl(url),
|
||||
url,
|
||||
visibleInPicker: true,
|
||||
ownerId: global ? null : user.id,
|
||||
category,
|
||||
|
|
|
|||
Loading…
Reference in a new issue