Trim is not a sanitization method


#1

Hi,

Why I’m getting trim is not a sanitization method error?


#2

Hello, can you give more details please


#3

Hi,
Thank you for your response.

When I apply sanitize rule trim on my post data I’m getting the error, trim is not a sanitization method.

const { validateAll, sanitize } = use('Validator')
const sanitizationRules = {
                title: 'escape|strip_links|strip_tags|trim',
                author: 'escape|strip_links|strip_tags|trim',
            }
       
const postData = sanitize(request.all(), sanitizationRules)


Reference : https://indicative.adonisjs.com/docs/trim