We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56ad9e5 commit f5640b4Copy full SHA for f5640b4
app/controllers/api/v1/lookup.js
@@ -22,17 +22,16 @@ async function lookup(ctx) {
22
23
const domain = await Domains.findOne(query).lean().exec();
24
25
- if (!domain)
26
- return ctx.throw(
27
- Boom.notFound(ctx.translateError('DOMAIN_DOES_NOT_EXIST'))
28
- );
+ let aliases = [];
29
30
- const aliases = await Aliases.find({
31
- domain: domain._id
32
- })
33
- .populate('user', config.userFields.isBanned)
34
- .lean()
35
- .exec();
+ if (domain) {
+ aliases = await Aliases.find({
+ domain: domain._id
+ })
+ .populate('user', config.userFields.isBanned)
+ .lean()
+ .exec();
+ }
36
37
const username = isSANB(ctx.query.username) ? ctx.query.username : false;
38
0 commit comments