Sort edit history from new to old

This commit is contained in:
Maciej Ziarkowski 2019-10-24 12:05:52 +01:00
parent aa59067d9e
commit ab04483479

View File

@ -99,7 +99,8 @@ async function getBuildingEditHistory(id: number) {
return await db.manyOrNone(
`SELECT log_id as revision_id, forward_patch, reverse_patch, date_trunc('minute', log_timestamp), username
FROM logs, users
WHERE building_id = $1 AND logs.user_id = users.user_id`,
WHERE building_id = $1 AND logs.user_id = users.user_id
ORDER BY log_timestamp DESC`,
[id]
);
} catch(error) {