'why I dont get the params when using RTK Query?

I want to send a verfiy code to my nodejs server.

API:

app.get('/verify_code/:code', (req, res) => {
    console.log(req.params);
 
    res.json({error: true});
});

If I type it on URL with my browser it works, but with RTK Query I dont get anything and no console.log statement. why?

RKT Query:

    VerifyCode: builder.mutation<IForgotPasswordResponse, IForgotVerifyCode>({
      query: (code) => ({
        url: '/verify_code/',
        method: 'GET',
        params: code
      })

What I am doing wrong ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source