mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 04:03:49 +01:00
fix: keep file order (#8659)
This commit is contained in:
parent
36db202263
commit
b3ca8d5329
@ -172,10 +172,14 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||||||
let files: DriveFile[] = [];
|
let files: DriveFile[] = [];
|
||||||
const fileIds = ps.fileIds != null ? ps.fileIds : ps.mediaIds != null ? ps.mediaIds : null;
|
const fileIds = ps.fileIds != null ? ps.fileIds : ps.mediaIds != null ? ps.mediaIds : null;
|
||||||
if (fileIds != null) {
|
if (fileIds != null) {
|
||||||
files = await DriveFiles.findBy({
|
files = await DriveFiles.createQueryBuilder('file')
|
||||||
userId: user.id,
|
.where('file.userId = :userId AND file.id IN (:...fileIds)', {
|
||||||
id: In(fileIds),
|
userId: user.id,
|
||||||
});
|
fileIds,
|
||||||
|
})
|
||||||
|
.orderBy('array_position(ARRAY[:...fileIds], "id")')
|
||||||
|
.setParameters({ fileIds })
|
||||||
|
.getMany();
|
||||||
}
|
}
|
||||||
|
|
||||||
let renote: Note | null = null;
|
let renote: Note | null = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user