unattached-media: cid --> url

This commit is contained in:
Alex Gleason
2023-09-09 18:12:54 -05:00
parent c88b174d02
commit e8053ba072
4 changed files with 8 additions and 8 deletions

View File

@@ -28,9 +28,11 @@ const mediaController: AppController = async (c) => {
const { file, description } = result.data;
const { cid } = await uploader.upload(file);
const url = new URL(`/ipfs/${cid}`, Conf.mediaDomain).toString();
await insertUnattachedMedia({
pukey: c.get('pubkey')!,
cid,
url,
data: {
name: file.name,
mime: file.type,
@@ -39,8 +41,6 @@ const mediaController: AppController = async (c) => {
},
});
const url = new URL(`/ipfs/${cid}`, Conf.mediaDomain).toString();
return c.json({
id: cid,
type: getAttachmentType(file.type),