add awaits

This commit is contained in:
Boegie19 2023-04-24 16:48:27 +02:00
parent f0a4d8e541
commit c1541c4268

View File

@ -178,15 +178,15 @@ const decorator = (service) => ({
}; };
const result = strapi.db.query(uid).findOne(query); const result = await strapi.db.query(uid).findOne(query);
if(result === null){ if(result === null){
return null return null
} }
// Since we change from findMany to findOne we need to restart the process so we use the entityService // Since we change from findMany to findOne we need to restart the process so we use the entityService
return strapi.entityService.findOne(uid, result.id) return await strapi.entityService.findOne(uid, result.id)
} }
return service.findMany.call(this, uid, wrappedParams); return await service.findMany.call(this, uid, wrappedParams);
}, },
}); });