UNPKG

notion-page-tree

Version:

Recursively fetch nested Notion pages from the root page/database/block node.

27 lines (26 loc) 924 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.suggestionServerHandler = void 0; var suggestionServerHandler = function (app, data_set) { // app.get( // '/suggestion', // (req: Request<unknown, unknown, unknown, { keyword: string }>, res) => { // !search_suggestion && res.sendStatus(503); // !req.query.keyword || req.query.keyword === '' // ? res.sendStatus(502) // : res.send( // JSON.stringify( // search_suggestion.filter(token => // token.match(new RegExp(`.*${req.query.keyword}.*`, 'g')) // ) // ) // ); // } // ); app.get('/suggestion', function (req, res) { data_set.search_suggestion ? res.send(JSON.stringify(data_set.search_suggestion)) : res.sendStatus(503); }); }; exports.suggestionServerHandler = suggestionServerHandler;