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) {
|
if (element instanceof File) {
|
||||||
const uploaded = await mediaManager.addFile(element);
|
const uploaded = await mediaManager.addFile(element);
|
||||||
|
|
||||||
url = uploaded.path;
|
url = Attachment.getUrl(uploaded.path);
|
||||||
contentType = uploaded.uploadedFile.type;
|
contentType = uploaded.uploadedFile.type;
|
||||||
} else {
|
} else {
|
||||||
url = element;
|
url = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
modified.url = Attachment.getUrl(url);
|
modified.url = url;
|
||||||
modified.contentType = contentType;
|
modified.contentType = contentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ export default apiRoute((app) =>
|
||||||
|
|
||||||
const uploaded = await mediaManager.addFile(element);
|
const uploaded = await mediaManager.addFile(element);
|
||||||
|
|
||||||
url = uploaded.path;
|
url = Attachment.getUrl(uploaded.path);
|
||||||
contentType = uploaded.uploadedFile.type;
|
contentType = uploaded.uploadedFile.type;
|
||||||
} else {
|
} else {
|
||||||
url = element;
|
url = element;
|
||||||
|
|
@ -175,7 +175,7 @@ export default apiRoute((app) =>
|
||||||
|
|
||||||
const emoji = await Emoji.insert({
|
const emoji = await Emoji.insert({
|
||||||
shortcode,
|
shortcode,
|
||||||
url: Attachment.getUrl(url),
|
url,
|
||||||
visibleInPicker: true,
|
visibleInPicker: true,
|
||||||
ownerId: global ? null : user.id,
|
ownerId: global ? null : user.id,
|
||||||
category,
|
category,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue