strapi-plugin-fuzzy-search-young
Version:
Register a weighted fuzzy search endpoint for Strapi Headless CMS you can add your content types to in no time.
18 lines (17 loc) • 772 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.populationSchema = exports.querySchema = exports.paginationSchema = void 0;
const yup_1 = require("yup");
exports.paginationSchema = (0, yup_1.object)({
pageSize: (0, yup_1.string)().matches(/^\d+$/, 'pageSize must be an integer'),
page: (0, yup_1.string)().matches(/^\d+$/, 'page must be an integer'),
withCount: (0, yup_1.string)().oneOf(['true', 'false'], "withCount must either be 'true' or 'false'"),
});
exports.querySchema = (0, yup_1.object)({
query: (0, yup_1.string)().required(),
locale: (0, yup_1.string)(),
filters: (0, yup_1.object)({
contentTypes: (0, yup_1.string)(),
}),
});
exports.populationSchema = (0, yup_1.string)().required();