UNPKG

stackpress

Version:

Incept is a content management framework.

16 lines (15 loc) 518 B
import search from '../actions/search'; export default function searchEventFactory(model) { return async function SearchEventAction(req, res, ctx) { if (res.body || (res.code && res.code !== 200)) { return; } const engine = ctx.plugin('database'); if (!engine) return; const seed = ctx.config.path('session.seed', 'abc123'); const response = await search(model, engine, req.data(), seed); res.fromStatusResponse(response); }; } ;