Fixed entity alias available through wrong type endpoint.

This commit is contained in:
DebaucheryLibrarian 2020-10-20 21:04:29 +02:00
parent 47238b2969
commit 6791053c83
1 changed files with 5 additions and 2 deletions

View File

@ -141,8 +141,11 @@ async function fetchEntity(entityId, type) {
if (type) {
queryBuilder
.where('entities.type', type)
.where((whereBuilder) => {
whereBuilder
.where('entities.slug', entityId)
.orWhere(knex.raw(':entityId = ANY(entities.alias)', { entityId }));
});
return;
}