mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 06:53:09 +02:00
fix: keep file order (#8659)
This commit is contained in:
parent
98e42ec6ff
commit
4b872856c2
1 changed files with 8 additions and 4 deletions
|
@ -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')
|
||||||
|
.where('file.userId = :userId AND file.id IN (:...fileIds)', {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
id: In(fileIds),
|
fileIds,
|
||||||
});
|
})
|
||||||
|
.orderBy('array_position(ARRAY[:...fileIds], "id")')
|
||||||
|
.setParameters({ fileIds })
|
||||||
|
.getMany();
|
||||||
}
|
}
|
||||||
|
|
||||||
let renote: Note | null = null;
|
let renote: Note | null = null;
|
||||||
|
|
Loading…
Reference in a new issue