diff --git a/src/models/index.js b/src/models/index.js index 8c2af6c..b395e68 100644 --- a/src/models/index.js +++ b/src/models/index.js @@ -225,7 +225,7 @@ const Hunts = { }, getAll() { - return db.prepare('SELECT h.*, COALESCE(u.display_name, u.username) as creator_name FROM hunts h JOIN users u ON h.created_by = u.id ORDER BY h.created_at DESC').all(); + return db.prepare('SELECT h.*, COALESCE(u.display_name, u.username, ?) as creator_name FROM hunts h LEFT JOIN users u ON h.created_by = u.id ORDER BY h.created_at DESC').all('[deleted]'); }, getByCreator(userId) {